Hey guys! I have a problem…
I have platforms in my game. I use object pooling to spawn them in front of the player.
Now the platforms are moving and what i want is when player jumps the platform will stop moving, that way he can time it and when he feels like the platform is in good position he will jump and the platform will “wait” until he lands and then leaves.
I don’t know how to reference the platform in front of the player in the script and then disable the script responsible for the movement.
What i tried to do is put a empty game object on the player and put a trigger on it. Then i placed it on the platform in front of the player. Since the platforms have the same distance between it would always touch the platform in front of him. After that i tried to use OnTriggerEnter Stay and Exit but none of them seem to work. OnTriggerExit worked the best but there was a little delay in disabling the script. I need it to be instant it would be awesome if it could respond to the MouseClick Input function that makes the player jump.