I seem to have a problem when entering a triggerzone. What i am trying to achieve is, whenever the player enters a certain zone (a well lit zone) What i tried to do is, put a sphere collider on the point light and attach this script:
Also use the collider as a trigger.
But this doesn't work. I also tried some tutorials that i could find on google. But they used the same method and didn't work either. Does anyone know a way how to achieve this?
asked Jul 25 '12 at 06:46 PM
not sure what the problem is though. See if adding a Debug.Log as above gets called, to rule out issues with the tag..
EDIT : sorry, forgot to mention before
You also need to have a rigidbody on one of the objects..
the matrix at the bottom of this link will explain what types of objects can send trigger message
just add a rigidbody to the trigger object and set "isKinematic" true
EDIT: now I think DO NOT set isKinematic true, this may cause the trigger not to work (unless it moves) as described by my experience here
but that's only if the player does NOT have a rigidbody, I believe
Make sure 'Is Trigger' is checked.
answered Jul 26 '12 at 09:53 PM