|
Thanks for taking the time to help me out I just need to change scene on a collision I already have this code in JavaScript
but this does not work at all
(comments are locked)
|
|
You should use a OnTriggerEnter function like this: function OnTriggerEnter(other: Collider) { if (other.gameObject.CompareTag == "Player"){ Application.LoadLevel("City"); } } and make the collider a trigger, so when the player touches the trigger, it will load up the level. hope this helps
(comments are locked)
|
|
If nothing happens at all the error is probably that the Collision is not triggered (wrong rigidbody/collider setup) or you didn't set the tag for your gameObject correctly. To see how to correctly setup collisions look at the manual. There's a "collision matrix" at the end of each collider's reference page. In short if you want to receive a collision event one of the two colliding objects will have to be a non-kinematic (dynamic) rigidbody. The other must be a Collider (not a trigger).
(comments are locked)
|

Question what error do you get if any?
no error but nothing happens