Well here’s the question: Can it be done?
The answer: YES!
Ignore that first part, here’s my issue:
when I use this thread it works, but only once. I can teleport the character but only one time. I was wondering what you think I should do to fix that?
Here’s the code:
var teleportDistance: float = 10;
var teleportTimeBreak: float = 1;
var characterPrefab: GameObject;
var teleportParticle: GameObject;
var characterTransform: Vector3;
function Update() {
if(Input.GetButtonUp("Jump")) {
Destroy(gameObject.FindWithTag("characterTeleporter"));
Instantiate(teleportParticle, characterTransform, Quaternion.identity);
Destroy(gameObject.FindWithTag("teleportParticles"));
Instantiate(characterPrefab, gameObject.transform.position + Vector3(0,0,teleportDistance) ,transform.rotation);
}
}
Yes. I have a prefab that holds the character. Every time I delete the character it instantiates another copy of it a certain amount of units away. The prefab has the same script. I am not really sure what the issue is, but i don’t think that’s it.
that’s true, but how is that done? Also the current script works with other scripts at the moment so those would have to be changed. If it is possible to fix the current one at the moment I’d prefer that.
first in transform.position you pass in teleport.x which looks like you dont ever assign. and instead of doing all that characterX Y Z stuff you should just use a vector3.