Archived

This topic is now archived and is closed to further replies.

Collision Response

This topic is 5652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I''m in the process is creationg this first person demo and I wanted to know if the technique I am about to propose makes sense. I am able to load my model and play its different animations when certain keys are pressed. Lets say the animation for a kick is called and the model is standing next to a box (the box has a breaking animation). Would it make sense to test for a collision with the box by seeing if the kick animation is called and then checking to see if the vertices of the player character collided with the vertices of the box? Is this the correct way to go about this?

Share this post


Link to post
Share on other sites
yea I know what you mean but the problem with that approach is that once the model collides with the box it will cause the breaking animation to be called, which is not supposed to happen. The breaking animation should be called if it is kicked.

Share this post


Link to post
Share on other sites
the way i see it, you want one collision response for normal situations (like running, walking, and other things that shouldnt break the box.) in this case, the player should just bump into it, right, and stop without breaking the box.

if you are kicking, you want to check the distance again, and if its close enough you break it.

i may have missed something...this seemed too easy.

Qatal

Share this post


Link to post
Share on other sites
If you are trying to make a demo with some form of combat, you may want to start now. Instead of breaking the box if the kick hits it by a vertex check, why not put a bounding box on the foot.

Then whenever your character is kicking, he is in GM_STATE_ATTACK, with an attack of "kick", which uses a bounding box of LEFT_FOOT. ( This information should be stored in a text file that is easy to change. )

While in GM_STATE_ATTACK, which lasts until the current anim is done playing, see if the LEFT_FOOT intersects anything that it can damage. If it does, do the amount of damage to that object specified in the "kick" attack. If it is enough to kill the box, play the breaking anim, else give an impulse ( hit reaction ) to the box. Now it will be easier to start kicking other people.

Share this post


Link to post
Share on other sites