// Update is called once per frame
void Update()
{
//If player Right clicks Set to face camera **mmorpg Camera**
if (Input.GetMouseButton(1)&&playerCamera!=null)
{
cameraRotation.y = playerCamera.transform.eulerAngles.y;
transform.eulerAngles = cameraRotation;
}
playerHeading = transform.forward * Input.GetAxisRaw("Vertical") + transform.right * Input.GetAxisRaw("Horizontal"); //Grab player input and immediately apply to create a player heading
playerHeading.Normalize(); //Prevent diagonal movement from being faster
//Check if Grounded
if(myPhysics.isGrounded)
myPhysics.AddVelocity(playerHeading * playerMoveSpeed*Time.deltaTime); //Send player heading over to physics system as a velocity
}
}
If you’re adding a velocity, then Time.deltaTime is incorrect there. Just add the velocity vector.
I guess that “myPhysics” is your own physics system. If you’re using Unity’s then you should also do your physics stuff within FixedUpdate, not Update.