|PC||Mac OSX||Oculus Quest|
onTriggerExit runs after leaving a trigger. As triggers are not solid, you may find that this runs quite some time after the onTriggerEnter effect, and generally is useful for things like automated doors or activating a chain of events when leaving an area.
- A string showing the name of the object
- A string showing the tag of the object
- object UID
- A string for custom numbering of objects / types, use tonumber(uid) to convert it to a number in the script
- object EID
- An integer identifier number that only exists for this specific object we are colliding with, is not the same as a UID which can be manually assigned in the editor or via script
function onTriggerExit(name, tag, uid, eid)
obj.set3DText("I left the " .. name .. " zone")
For more information on when this function will activate, see the Collision and Rigidbody pages.