Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Make player spawn at point when loading a scene.

$
0
0
In my game I'm making, I have a top down perspective. Its RPG style and when I have the player enter a building, it loads a new scene and starts the player at the door inside the house. Awesome. The trouble I'm having is when you exit that building, it spawns the player at the beginning point of that scene, not outside the building entered. I've seen tutorials about *transform* positions, and using *don't destroy on load* and even someone suggested using *prefabs and teleporters* I am new at using the Unity scripting references. I am just having a hard time with this, and its discouraging. Because of changes in **Unity 5,** many of the scripts don't function properly. Can someone help me understand how to write a script for this? I mainly use **Javascript** if(coll.gameObject.tag == "ExitDoorMom") var player = GameObject("ExitDoorMom"); Application.LoadLevel(0); This script (even though unity says its obsolete in 5) works for me. It allows me to load the scene. What can I add to it to **load a new scene, and once the scene is loaded, move the player to a specific position.** I'm not trying to have all the work done for me, I'm trying to learn. Any help would be much appreciated! Thanks again!

Viewing all articles
Browse latest Browse all 1875

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>