I would like to move my Player in "block" of 0.1 unity unit (or 1).
How to modify / configure Character controller to move with "fixed" step?
2 Answers
Answers 1
You can use transform.Translate to move the character
//moves the character 1 unit in x direction transform.Translate(1.0f, 0.0f, 0.0f);
Answers 2
If you want to use the Character Controller
component to move your object, you would want to use its dedicated methods:
Also, there's some difference between the 2 methods stated above.
The Move
method is more complex and performance wise. As it takes care of complex physics such as gravity, collisions and will move the object by motion.
The SimpleMove
method, instead, is more lightweight because it will only move the object without taking care of environmental physics.
If you want to move by a single unit, probably the code should look something like this:
//Controller being your character controller component Controller.SimpleMove(Vector3.forward);
0 comments:
Post a Comment