Hey guys,
I’m not an expert of UE4 and I’m really struggling to achieve what I want without taking a hit on performances.
Searching on the internet I’ve found that I might try using instanced static meshes but I don’t think it’s possible to do what I want to do with this solution.
Anyway, what I want to do is something like this:
Imagine a “factory A” producing 4/5 “A objects” (actors) every seconds.
These objects then move automatically to another “factory B” “capturing it”.
When factory B is captured it produces 4/5 “B objects” per second and redirects all of this objects (A+B) to another factory and so on.
Of course there are some things that destroy these objects at a certain point.
Anyway you can imagine how fast it gets to have many actors on screen and take a huge hit on perfomances.
So my question is: how can I achieve this without taking a huge hit on performances?
And if I have to actually use instanced static meshes, can you give me at least a hint on how I could make them collide and move them separately? (I’ve tried to use hierarchical instanced static meshes but it seems I cannot make them collide and move each instance separately to the others)
Thanks for the help
P.S. I’m actually using UE4 v4.23 but in the drop-down menu it only showed “4.23 Preview”
Basically they’re moving on a conveyor (I’m using event tick to change their offset) and they need to be separate actors because they have different properties.
E.g. The value of all objects A is 1$, the value of all objects B is 2$.
Just another note, I’ve tried to make them particle effects (so I don’t mind if I don’t actually use a real “conveyor” style thingie) but it seems it’s not possible to get what the particle collided with… and I wouldn’t know how to “redirect” those particles to another place/Particle System.
Anyway I would like to stick with the “conveyor” style thing if possible.
The conveyor may help, You could just have an array of static meshes and their position on the conveyor. Then they can be components on the conveyor. And when their position is > the conveyor length you can say they have reached the next step and remove them from the array. You can compare what mesh it is to see whatever data you need or just use a custom struct.
Problem is I cannot change the location (or offset) of each instance.
I just can get the transform but not set it.
Edit: I tried the “add component instanced mesh” solution but the issue remains. Of course I did it without using the instances because of the problem I wrote up here, so I added 1 component per object created but the performances are still bad (obviously because in this case each component = 1 object and not 1 component = multiple instances of the object).
Edit 2: ok… I’m definitely blind. There’s the “Update Instance Transfom” node and I didn’t see it. This might be the solution of everything.
Thanks for the help. I’ll come back when I’m done and let you know if everything’s fine.
Ok so I’ve tried with instanced mesh and it works but I’ve found out that the real problem might be the “moving” of the objects.
Moving lots and lots of actors (or even instanced meshes) just blows up the performances.
Using event tick is just not ideal for this and now I have to find a workaround to this problem…