What changed in 2018.3 that prevents teleporting the FPSController in Standard Assets
I have used the following code snippet for years as a simple teleporting demonstration for my students:
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Player")
{
other.gameObject.transform.position = spawnPoint.position;
other.gameObject.transform.rotation = spawnPoint.rotation;
}
}
I have always used the FPSController prefab from standard assets. However today the code didn't work. The FPSController did in fact teleport but only for an instant before it snapped back to the original position. The code works as intended if I use the RigidBodyFPSController. Placing in a break point in FixedUpdate in the FirstPersonController script, I can see that it remains at the teleported location for 3-6 frames before snapping back.
What has changed in the code that is causing this bizarre behavior? I plan on printing it out and going over it line-by-line later this week, but for now I just can't see anything in the code that explains this delayed behavior.
Your answer
Follow this Question
Related Questions
have an error that i don't know how to fix 1 Answer
BasicFPS controller "Can not be loaded" 0 Answers
thirdpersoncontroller multiplayer animations 0 Answers
Moving on the XZ plane 0 Answers
How can I fix my jumping script? 0 Answers