I am using my own Physics system as I needed a double precision physics, but I’m having performance issues with the way Unity deals with it.
It seams like the process is very slow when I have around 6000 objects within a parent object and I move Only the parent object.
I have no rigidbody in the scene.
When I want to move an object using my physics engine, I set the object’s localPosition in FixedUpdate().
In the profiler I see that the most CPU is on Transform.INTERNAL_set_localPosition()
and it’s number of calls match the total number of child objects plus the parent object.
And it becomes worst as I have more child objects in the object.
Remember I am not moving the child objects here, only the parent, and it does that.
Looks like Unity calculates everything as absolute and when setting an object’s position, all it’s children are also “moved” even though their localPosition has not changed ?
Is there a way to optimize this ?
Also, I tried with and without the “Static” checkbox for all objects… doesn’t make any difference.
What is the difference with or without Static in my case ?
Thank you.