Save system position glitching with the below code

I use this code to simulate gravity and I using character controller.

protected virtual void Gravity()
{
   playerVelocity.y += gravityValue * Time.deltaTime;
   controller.Move(playerVelocity * Time.deltaTime);
}

I am able to save the transform position, but whenever I try to load the character from a new position the character glitches to saved location , and stays in the new position. I am using my own movement code.

The save system works fine when I disable the above code

Like the NavMeshAgent, you need to disable the CharacterController before changing transform.position or CharacterController will just snap it back.

Thank you ! was able to fix it

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms