- Home /
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);
Answer by testure · Aug 22, 2011 at 04:38 PM
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 Simple$$anonymous$$ove on this project, but I'm not sure yet what controls might be needed down the line. I'll keep it in $$anonymous$$d.
I forgot to mention this was for iphones etc. added it to my question. Would it still be negligible you think?
keep in $$anonymous$$d that the character controller's Simple$$anonymous$$ove 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 Simple$$anonymous$$ove, save the profiler snapshot, then repeat the test with $$anonymous$$ove. I wouldn't be surprised if the result is identical.
Simple$$anonymous$$ove 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 $$anonymous$$ove.
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.