Hello guys, I am currently having a problem with my game. There is a player (purple) who has to go through the rings. If he passes a ring, nothing should happen, but if he does not hit the ring, an animatioon should be played. My question is: With which method is it possible to detect if the player passed a ring or not? Can i may have an example?
It’s hard to say from just that screenshot but I’m assuming your game movement is linear so you could just compare the z pos of the player with the rings z pos and do something if the player has passed it.
To tell if you miss a ring, start tracking distance to ring when you are closer to the ring than a ‘start tracking’ trigger distance. if the distance then increases over a (different, larger) trigger distance without having hit, treat that as a miss. It’s similar in logic to a proximity fuse in missiles.
1 Like