Coucka
Coucka

Reputation: 37

Unity 3D Character Controller.move forward strangely at certain rotation

I'm trying to make a custom 3 Person Controller. I'm using a Character Controller, so I translate my "Player", with his Character Controller. Like that :

_ownController.Move(transform.forward * Time.deltaTime);

I want the Player to go forward depending of his rotation. When I did this with Player.Translate() it works perfectly well, since I changed to this It's not working at all, but I need physics on my Player :(

Please, help me I'm going to be desperate, it's like a couple hours I'm stuck on that :(

Upvotes: 0

Views: 5751

Answers (1)

Karthik
Karthik

Reputation: 129

Try using this for your transform.TransformDirection(Vector3.forward) to find your forward direction. Because transform.forward gives forward direction, specifically 'blue axis' direction in world space. Whereas, transform.TransformDirection, gives direction in local space

Upvotes: 3

Related Questions