Collision possibilities
by Glenn Thomas · in Torque Game Builder · 09/04/2007 (9:26 am) · 2 replies
I was wondering if TGB is able to check multiple types of collision on multiple areas within a single object. For instance, if I make a fighting game and I want my character to react differently depending whether the character was hit in the head, shoulders, knees, or toes while simultaneously checking to see if my character has collided with another characters vital points as it attacks. This is so I can get a who hit who where first type of response or measure if two attacks collided with one another for a double reaction. This will also empower me to be able to create counters, aggressive and evasive blocking, and parries.
Any insight on this situation would be help me out immensely, it would also be beneficial if someone would also instruct me on how to go about setting this up in torque as well.
Thanks in advance,
Glenn
Any insight on this situation would be help me out immensely, it would also be beneficial if someone would also instruct me on how to go about setting this up in torque as well.
Thanks in advance,
Glenn
#2
09/04/2007 (9:18 pm)
That should work I will have to test it and see but it sounds like a good way to get what I need accomplished. Thanks a lot, I appreciate the help. If anyone else has any other possible solutions to the problem or decided to do some of their own tests regarding this issue and would like to share, I'm sure it would be beneficial to myself and the community.
Associate James Ford
Sickhead Games
But you could have the hitboxes as separate sceneobjects which follow the player around. The problem there is, I don't think mounted objects register collisions (they don't in TorqueX but you would have to test this idea), so you might need to manually set their position each tick, and even then there might be some delay where the hitboxes are slightly behind the animation, you would really have to try it out to see.
The torque collision system and mounting are useful for some specific things but with others it is best to avoid them altogether.
I'm thinking of a simpler way... If you define each hitbox as an offset from the character and a size, and the offset could change for different animation frames, then each tick use pickrect within each hitbox to determine if there is a "collision". Different attacks/moves could strike different world positions in relation to the attacker and you check that area to see what hitbox you hit, or, hands/feet could have their own hitboxes, and you do pickrect within them each tick to see if they contain an enemy's hitbox. Any sortof physics reation to a hit would need to be "simulated" whenever contact occurs.