I have new object that has a sphere collider on it, I am trying not to use on huge script on the main character controller. The code is correct but not sure where to attach this new script too. When attached to the FPC the trigger events work but the Start() does not, when attached to the object the Start() works but the on trigger events do not. Now sure where I am going wrong.
When adding a script, it has to be on a game object within the scene.
If you’re saying that the “on trigger events” do not work, the simplest reasons are:
-
The object you’re trying to manipulate isn’t set as a trigger. (Look at the collider on it. There is a checkbox that says: “Is Trigger”. Make sure that’s checked.
-
The formatting of the script. OntriggerEnTeR() vs OnTriggerEnter()