- Home /
Mobile Third Person Controller doesn't follow Camera Direction
I used this tutorial for the controller:
https://www.youtube.com/watch?v=ImuCx_XVaEQ&list=PLuKOUI6XK9hZf5D6dZGNDEK-FXVJdNEzD∈dex=7&t=747s
It works perfectly fine until I tried to Build the project and test it on my android phone. The controller does not move in the direction of the camera. I tried it back on unity and the same happened, It no longer moves according to the direction of the camera. I tried removing it and replacing it with a prefab I made before building the project, and it seems fine.
I figured out that this code:
Vector3 move = new Vector3(movement.x, 0, movement.y);
move = cameraMainTransform.forward * move.z + cameraMainTransform.right * move.x;
affects it so I opened the values for "cameraMainTransform.forward" and "cameraMainTransform.right" and the values were not moving. They were fixed, that's why the controller doesn't move according to the direction of the camera. Anyone knows why this is happening and how I can fix it?
This are the values that are shown constantly on the camera transform position forward and right after building the android project. It should be displaying a moving value since I can change the camera position.
Your answer
