- Joined
- Apr 19, 2011
- Messages
- 447
Hi.
Well I just want to know what would be the best way to detect a frontal collision with an obstacle. To a better understanding of what I mean, look at the pictures. The big red circle is the obstacle, the blue circle is the player, and the blue arrow points the direction the player is moving to:
This is meant for a race-type minigame I want to include in my main proyect. The player controls a racer, and must run through a circuit with obstacles, and things like that. The objective of the game is to get through the circuit in the less possible time, and I want the player to knock back and lose time if he collides with an obstacle, but ONLY if he is running towards the obstacle itself. In other words, I want to make it a bit realistic.
I thought about creating a region over the obstacle, keeping a dummy unit at a small distance from the player in the direction he is facing, then activating the knockback when the dummy enters the region, but I don't think this is too effective.
Do you have any ideas?
Regards
Well I just want to know what would be the best way to detect a frontal collision with an obstacle. To a better understanding of what I mean, look at the pictures. The big red circle is the obstacle, the blue circle is the player, and the blue arrow points the direction the player is moving to:
This is meant for a race-type minigame I want to include in my main proyect. The player controls a racer, and must run through a circuit with obstacles, and things like that. The objective of the game is to get through the circuit in the less possible time, and I want the player to knock back and lose time if he collides with an obstacle, but ONLY if he is running towards the obstacle itself. In other words, I want to make it a bit realistic.
I thought about creating a region over the obstacle, keeping a dummy unit at a small distance from the player in the direction he is facing, then activating the knockback when the dummy enters the region, but I don't think this is too effective.
Do you have any ideas?
Regards