Hello there, I’m working on a project for that I need to duplicate an item with another name after stored into array. The item to be duplicated is a Render Target 2D. I create the Render Target using “Create Render Target 2D”, then I store it into array, and set it as texture parameter value of an instance material. I draw on it for a period with a brush, then I would clone it and store into another index of the array in order I can use it as start reference for another material instance. For to this I presume I should duplicate it. I know that I could solve setting variables, but it would be just for a setted number of cicles. Instead I need do it for an unfixed number of time.
How can I solve it? Many thanks in advance. Please say me if the logic is wrong.
Are you trying to achieve this through blueprints? I’m not actually sure if it’s possible to clone objects within blueprints or not (I’m sure there will be a way), however I thought I might offer an alternative approach.
To me, it sounds like you want to basically capture the history of ‘brush’ strokes made by the player. Presumably to play back later or allow some undo / redo option. Capturing a render texture for each of these periods will become expensive. It can be quite slow and will use a lot of memory (which will be a problem if you’re releasing on a mobile platfom). So instead, why not record information about the brush as it paints. You can capture all of this data into an array each frame, or at some suitable time interval and then when you need to, you can ‘replay’ that stroke simply by running the array and performing those actions again.
Thanks for reply!! My aim is not to record the brush strokes, i need store just the results (the texture). However It is possible to do it using some blueprint nodes available into the engine (Only in the editor). So to have the same results in a packaged project i thinked that I should clone the item after stored into array. But actually I have not found solution.
WOuld it work to use a reference instead of a deep copy as the item in the array?