I am currently trying to make it so when my player object hits a certain objects collider the players spped is set to 2 when it’s normally 10 and then 5 seconds later it’s reverted to normal. I am currently trying to use the code below:
IEnumerator SlowPowerUp () {
speed = 1;
yield return new WaitForSeconds (5.0f);
speed = 10;
I then want this to run in the void OnTriggerEnter but I don’t know how to properly call it. Can anyone help me please?
NOTE: I’ve solved it