MannyGT Posted November 10, 2016 Share Posted November 10, 2016 Hi there. It seems that using the trick of integer variable as seen in creation kit page (https://www.creationkit.com/index.php?title=OnTriggerEnter_-_ObjectReference) is not working anymore: This event can be received out of order with OnTriggerLeave, so it's ideal to keep a count instead of a simple true/false value for when things are inside the trigger. Int InTrigger = 0 Event OnTriggerEnter(ObjectReference akTriggerRef) if (InTrigger == 0) if akTriggerRef == Game.GetPlayer() InTrigger += 1 debug.notification("Entered Trigger") endif endif EndEvent Event OnTriggerLeave(ObjectReference akTriggerRef) if (InTrigger > 0) if akTriggerRef == Game.GetPlayer() InTrigger -= 1 debug.notification("Leaving Trigger") endif endif EndEvent Anyone had this trouble? I'm removing this trick from all my scripts. Link to comment Share on other sites More sharing options...
MannyGT Posted November 10, 2016 Author Share Posted November 10, 2016 Nevermind, my mistake with properties Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now