void Awake()
{
cameraObject = Camera.main.transform;
}
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
PlayerInput();
PlayerMovement();
PlayerRotation();
}
void PlayerInput()
{
horizontalInput = Input.GetAxisRaw("Horizontal");
verticalInput = Input.GetAxisRaw("Vertical");
}
void PlayerMovement()
{
moveDirection = cameraObject.forward * verticalInput;
moveDirection = moveDirection + cameraObject.right * horizontalInput;
moveDirection.Normalize();
moveDirection.y = 0;
moveDirection = moveDirection * moveSpeed;
}
InGame, I can’t move my Object…
Ridiculously, my object’s position falls down to something value with Euler… help pleaseeeeee