CharacterController Move vs. SimpleMove

Is there any performance difference in using Move with gravity in the Vector or just SimpleMove? I’m not sure what simplemove does behind the scenes so I thought I’d ask.

Edit: This is for iOS mobile devices where many charactercontrollers on screen take a good bite out of the FPS. So I’m looking for any kind of performance difference.

Like between these two: (supersimple gravity setup for clarity)


Simplemove:

charControl.SimpleMove(new Vector3(1,0,1);

Move:

If(charControl.isGrounded)
   charControl.Move(new Vector3(1,0,1);
else
   charControl.Move(new Vector3(1,-1,1);

1 Answer

1

the difference in performance is negligible… you want to use Move if you need more control (IE jump, flight, gravity reversal or planetary gravity, etc)

Thanks, that makes sense. I think I could get away with SimpleMove on this project, but I'm not sure yet what controls might be needed down the line. I'll keep it in mind. I forgot to mention this was for iphones etc. added it to my question. Would it still be negligible you think?

keep in mind that the character controller's SimpleMove still needs to perform the same calculations to create gravity. You could probably do some load testing and get a real number.. put 250 or so character controllers in a scene and move them all ten meters simultaneously with SimpleMove, save the profiler snapshot, then repeat the test with Move. I wouldn't be surprised if the result is identical. SimpleMove is just a convenience method.. I use it for AI, since in my game only special AI types can jump or fly- and they use Move.

Thanks, will test. Although 10 of them is probably enough to make the iphone 4 start to chug if they all bunch up on the player. Looking at all the options here, any tips welcome. Next up is to disable collision between NPCs and give them a simple soft keep-apart behavior. Been looking at rigidbodies too. They're faster, but very unpredictable compared to the charactercontroller.