I have a OnTriggerEnter() which I want as a collection zone for the player.
So, when the player enters the zone, I want a collection variable to increase by 1 or something everytime the player moves within the zone. Also, as this variable increases, I want the animation on the player (animSpeed) to decrease, so the more the player collects, the slower the player moves. I need a maximum collection total and maybe a 0.5f timer delay between each collection.
So far, I have the OnTriggerEnter() with a script that checks for player movement with the zone. I’ve tried increasing the collection variable, which kind of works but I dont know how I decrease animSpeed. It is set at 1.5f, so I want it to decrease by 0.1 for every 5 collections.
Can anyone help?
OnTriggerEnter() get fired only once when the player enter the zone. It will not fire again when player moving inside the zone.
OnTriggerStay() get fired when the player is inside the zone