So Small problem. I'm able to rotate my camera around my player AND rotate the player when the camera moves around it, but the controls don't seem to move with it. Example: W moves forward. If I look right then W should move forward in that direction. It doesn't, instead it will go left (the forward as it was before).
[SerializeField] GameObject GameCamera;
private void PlayerRotateWithCamera()
{
Quaternion CharacterRotation = GameCamera.transform.rotation;
transform.rotation = CharacterRotation;
}
private void FixedUpdate()
{
PlayerRotateWithCamera();
MovePlayer();
}
I only think the player is rotating cause it looks like it is, but if you look at the move tool the axis dont seem to move with the Player
Just in case my movement isn't getting along with the rotation:
private void MovePlayer()
{
moveHorizontal = Input.GetAxis("Horizontal");
moveVertical = Input.GetAxis("Vertical");
// more realistic ball movement
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.AddForce(movement * moveSpeed);
}
I also have Tool handle rotation set to global because it's a ball, and well, those axis obvious go crazy while rolling around.
Any help at all would really be appreciated!