- Home /
how to create a spawner
i dont any idea on how to create a spawner, what i mean is when you're done on the first map then to transfer the player into other map or location.. just like a portal or whatever
Answer by Lovrenc · Dec 30, 2012 at 04:30 PM
I think he means different location on same Level.
Your spawner code would look like this i guess:
public Transform otherTeleport;
void OnCollisionEnter(Collision collision) {
if(collision.gameObject.Tag == "Player") {
collision.Transform = otherTeleport;
}
}
otherTeleport is teleport to which you want to spawn from this portal. Can also use OnTriggerEnter if you want.
WARNING: be sure otherTeleport ACTUALLY IS other teleport otherwise you'll get nasty loop.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
"MissingMethodException: Method not found:" (Javascript) 1 Answer
Help with flappy bird random spawn 2 Answers
How to import the object from server to unity 2 Answers
Can someone help me fix my Javascript for Flickering Light? 6 Answers