Hello everyone, I’ve been doing some on device testing (in my case an iPhone 4) using the free Unity profiler and default Unity physics settings, and noticed that in a particular scene physx is taking around 40-60ms to render about 30-40 objects that are kinematic rigidbodies controlled through scripts (use no real physics).
-The scene in question is a “frogger” type setup, where rocks move along a straight path and bob up and down (all according to script), and when a player stands on them, they begin to sink.
Each rock has a mesh collider and a mesh trigger.
The primary script methods used to move these rocks are Vector3.Slerp, Vector3.MoveTowards, and Vector3.Distance.
I have been reading around and apparently for the number of objects on screen, this is a very significant amount of time spend on physx. So, I was wondering what the best to way go about cleaning this up is? Changing physics settings? Different object setup? Different script methods? Any help is appreciated.
I should also mention that at this point, for convenience these rocks are instantiated and destroyed (not recycled) and the garbage collector tops out at around 5.