- Home /
Unity animation no longer works for large numbers of objects
I am working on a 3D animation in which I create a number of pedestrians and move these through a game space in real time. The positions of each of these pedestrians (created in unity as GameObjects) is loaded into unity via XML. The GameObjects are then told to move from one position to the next making use of the Lerp function. This works well for small numbers of GameObjects (ie < 10) but anything more than this and the whole thing stops working properly. If there are too many GameObjects all objects are instantiated so that goes well but only 1 of the objects actually moves through the game space. All the others remain stationary, although their personal animations do continue to work (they appear to moonwalk at one point in space).
I have no idea why the program would stop working with large numbers as the code behind it is relatively simple. Any help would be greatly appreciated.
$$anonymous$$gest you to take a look at HOTween or other tween engines for unity.
So I've looked into tweening a little bit now, but I'm unsure how this will help me. I have around 100 different GameObjects, each of which follows its own path (stored in an Array). Even if I use simple Spheres ins$$anonymous$$d of people and thereby remove all animation I get the same problems. From what I understand, tweening can help me if I have a large number of objects using the same animation, which I am not, or am I not grasping the tween concept correctly?
Your answer
Follow this Question
Related Questions
Why does simple animation make my game lag? 2 Answers
Colliders run slower on animated objects? 1 Answer
Why is the animation editor dog slow? 1 Answer
Use animation and script at same time? 0 Answers