Nature of CharacterController.SimpleMove

When I execute a snippet like this one:

var forward = transform.TransformDirection(Vector3.forward);
var curSped = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSped);

… how does the SimpleMove function relate to a basic transform.Translate?

Specifically, if I wanted to replace the last line of code with a transform call to effect the same kind of translation achieved with the CharacterController call, how would I do that?

TIA!

I’d use Move instead of simpleMove. This link does almost the same as a regular transform:

http://unity3d.com/Documentation/ScriptReference/CharacterController.Move.html

Thanks, daclo.

Acutally though, I don’t want use a Charactercontroller at all.

Well, given the description of SimpleMove in the docs it sounds like a translate call with any y-values stripped out (well, set to zero). Something like this (untested forum code!):

var forward = transform.TransformDirection(Vector3.forward);
var curSped = speed * Input.GetAxis ("Vertical");
var simpleForward = Vector3(forward.x, 0, forward.z);
transform.translate(simpleForward);

Thanks, Tom.

You need to capitalize the “T” in Transform, BTW. :wink:

Unfortunatly, your suggestion is pretty much what I’m doing, so my problem must be somewhere else. I was hoping maybe the SimpleMove did something little bit of wierdness that I needed to compensatre for. Apparently not.

Oh, well.

Thanks again, all!

Perhaps you meant in “Translate”… :stuck_out_tongue: Sorry it wasn’t much help but that’s my understanding of SimpleMove…

Doh! The one time I get to correct you and I blow it! :wink:

Nice new icon, BTW!

Still, I’ve got to wonder how long you’ll be happy with one with no biker imagery in it.

What is the problem or result that you are looking to alter/change?

– Clint