OnTriggerEnter not working

Updated 2 days ago in General
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on December 15, 2018

using UnityEngine;

public class gameover : MonoBehaviour {

    public void OnTriggerEnter(Collider collider)
    {

     print(“Gameover”);
    }
}

this is not detecting any trigger the option “is Trigger” is checked too.

  • Liked by
  • bennie3211
Reply
1 on December 16, 2018

Do you have the ‘trigger’ checkbox on your collider checked (in the editor)?

Edit: Just saw your comment at the bottom of your post…
It’s been awhile since I’ve used the print function. Are you calling that correctly?
And does the object that is entering the trigger zone also have a collider?

Helpful
2 days ago

Its Debug.Log(“”); So I don’t think it will display the message correctly

Show more replies
  • Liked by
Reply
Cancel