I have a simple script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TeleportBack : MonoBehaviour
{
public Vector3 teleportPosition;
void OnTriggerStay(Collider other){
if(other.gameObject.tag == "Player") {
other.transform.Translate(teleportPosition, Space.World);
Debug.Log("Teleported Player back");
}
}
}
It works and all, but the StandardAssets FPSController only gets teleported “visually” to the position while on the collider trigger(in editor the coordinates also change only visually and in game the camera stays on the “visual” coordinates). When walking out of the trigger(with the physical coordinates) player visually goes back to his physical coordinates.
Any ideas?