Unity: How to move a player using a character controller in a step?

I would like to move my Player to a “unit” unit of measure unit units (or 1).

How to change / configure the character controller to move with a fixed step?

+4
source share
2 answers

You can use transform.Translate to move a character

    //moves the character 1 unit in x direction
    transform.Translate(1.0f, 0.0f, 0.0f);
+3
source

If you want to use a component Character Controllerto move an object, you must use its special methods:

, .
Move . , , .
SimpleMove , , .

, , :

//Controller being your character controller component
Controller.SimpleMove(Vector3.forward);
+2

Source: https://habr.com/ru/post/1694441/


All Articles