Hi everyone!
I found this script (below) and attached it to an enemy who is following the player and once they collide, a level will load (in this case, I created a Death scene)
var levelToLoad : String;
function OnTriggerEnter(hit : Collider)
{
Application.LoadLevel(levelToLoad);
}
The script actually worked, but I just realized it’s not working when my character is not moving which let the enemy revolve around my character until I start to walk then the level changes.
What I want to achieve though is something that would load a level once my enemy game object catches my character even in idle mode. Is it possible to load a scene through distances of game objects? If not, how can I load a scene with my character in idle animation? Really need some script for this…Thanks guys.