Can anyone help me make a script where if the first person controller’s collider hits the terrain, to application.loadlevel ?
Im new with coding, so I am kinda trying to understand it. Thanks! ![]()
Can anyone help me make a script where if the first person controller’s collider hits the terrain, to application.loadlevel ?
Im new with coding, so I am kinda trying to understand it. Thanks! ![]()
Your question is more suited for the collaboration section of the forum where you can pay or trade for script work. This section of the forum is more for those who have started to learn and post scripts that have errors.
Also you need to explain a little better what you want your script to do. Hitting the documentation and tutorials is the best least expensive way to get what you need. ![]()
Well, I am creating this parkour game, and I want it to be so if you fall, and hit the ground, Terrain To have a script to update the function Application.loadlevel.(LEVELHERE)
The above links to the script reference should give you everything you need to write this script.
Try this little script. Don’t forget to tag the terrain. This script is untested but looks like it would work lol.
These basic examples came from the doc / Scripting Reference
var yourSceneName : String;
function OnControllerColliderHit(hit : ControllerColliderHit) {
if(hit.collider.tag=="Terrain") {
Application.LoadLevel("yourSceneName");
}
}
I don’t have any experience with UnityScript, so I am not sure if there are unconventional quirks about it, but wouldn’t line five of that snippet need to be without the quotations?
Application.LoadLevel(yourSceneName);