|
How to teleport a character? I mean the player from a scene 1 to a Scene 2? And is it possible to link the triggers,variables or switchs between two scenes? Thank you.
(comments are locked)
|
Of course; very rarely is it 'impossible' to do something of that sort. To 'teleport' the character from one scene to another, you'll want to use Application.LoadLevel() to load the new scene, and then (if necessary) position the character at the appropriate location in the scene. As for data that persists between levels, here are three options:
listen I've made a script here but it doesnt work here is it : function OnTriggerEnter(other : Collider) { if (Input.GetKeyDown ("e")) Application.LoadLevel (1); } function Awake () { DontDestroyOnLoad (transform.gameObject); transform.position = Vector3(71,79,-456); } Is there anyway you can tell me what's wrong with it? or even tell me what script i should use?
Feb 15 '11 at 12:30 PM
Moltvatch
You don't want to use GetKeyDown() (or the Input class in general) in OnTriggerEnter(), I don't think. One way or another, you'll probably need to rearrange your logic so that the collision is detected in OnTriggerEnter(), but checking for input happens in Update().
Feb 15 '11 at 01:29 PM
Jesse Anders
(comments are locked)
|
|
Ok thank you then! please, this is not an answer, use comments to comment or thanks for something, answer as the name says is to answer a question not to thank for something.
Feb 12 '11 at 10:52 PM
Uriel_96
I'll call you when I need some idiot to make me advices.
Feb 12 '11 at 11:19 PM
Moltvatch
Thanks for the thank you :) But please, don't be rude to your fellow forum members. Posting a comment or reply as an answer is a common mistake - no biggie. Uriel was just making you aware of how the forum works for next time.
Feb 13 '11 at 02:04 AM
Jesse Anders
(comments are locked)
|
