Reputation: 7170
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?
Upvotes: 4
Views: 3407
Reputation: 326
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);
Upvotes: 3
Reputation: 1538
//moves the character 1 unit in x direction
transform.Translate(1.0f, 0.0f, 0.0f);
Upvotes: 3