- Home /
Stop player following cameras cameras direction
Okay I'm not going to go to much into it but this is what I need my script to do. The way I have my controller set up is that the camera looks to the side of the player a little bit. I use this for aiming attacks, bullets and what not. The problem is that it follow the camera when it looks up causing my character to slightly jump ever time I aim and look up. So i want the player to move with the camera while ignoring its y axis. and i need my character to jump so i cant just make the players y movement = 0.
Here's the code I've been using:
transform.position += Time.deltaTime cameraMain.forward Input.GetAxis("Vertical") * speedWilAim;
and I am trying to avoid separating the mouse look script into x and y pivots but if there is no alternative I will do that.
idk if I understood it well, by why dont the camera follow a target in the character when in ai$$anonymous$$g mode?
the main problem with this script is when you look up with the camera and move forward the character goes up. I just want my character to go forwards not upwards
Vector3 temp = camera$$anonymous$$ain.forward; temp.y = 0.0f; temp.Normalize();
Does it solve?