(10-14-2012, 02:14 PM)4WalledKid Wrote: (10-14-2012, 09:31 AM)The chaser Wrote: No, it isn't
Let's say you have a map where you have a door and a key. The key opens the door. If the player leaves and everything was in OnStart(), when the player returns that key will be useless, because it was only usable the first time you went into the map. OnEnter () is more for "bug fixing".
So OnEnter() will call the functions every time the player enters the map until I use some "if" statement?
To explain Andyrockin's script: A variable is just a number that you can change. In the script, each time the "OnEnter" function is called, we increase the variable by 1. Then we check whether or not the variable is equal to 3. If it is, the game moves on to do whatever we specified inside the { } brackets.