|
Post by starke on Jul 9, 2021 19:30:15 GMT
Hey there. I am relatively new with Unity. I implemented the third person basic locomotion form Invector as my controller. I don't use the Invector camera system, because I have my own fixed camera system.
Everything was working great until I tried to implement a simple teleporting script:
public class Teleporter : MonoBehaviour
{
public Transform teleportTarget;
public GameObject transportedObject;
void OnTriggerEnter(Collider other)
{
transportedObject.transform.position = teleportTarget.transform.position;
}
}
In most cases, I am transporting the player, but it could be NPCs too. The script works. When I enter the collision for a split second I can see the player transport to the "teleportTarget" then immediately in another flash I see him shooting up very high. I paused the game and located him extremely high above the terrain. Any idea why this would happen? Is their something in how the third person controller operates that doesn't like how I changed the transform position of my controller?
I'm stumped. Any ideas? Thanks!
|
|