Physics vs Hitboxing: Round 1

For questions about using Classic.

Post » Wed Feb 04, 2009 9:11 am

Ok, so after reading a number of tutorials on platformers, I have found that there are tons of recommendations to use a separate hitbox for your hit detection. The game I am currently working on uses the physics behavior to do the math for elastic collisions. Is the use of a seperate hitbox recommended here? Thanks again for all you help everyone!
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Wed Feb 04, 2009 12:38 pm

That all depends on what kind of game you're making, and what you need the hitbox to do, and what you need the player to do, etc.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Feb 04, 2009 2:02 pm

Ok. I suppose this would be an appropriate time to ask what the real benefits of using a hit box are?
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Wed Feb 04, 2009 2:16 pm

Okay... as I explained in the tutorial, the platform behavior will "push out" of solid objects when it's intersecting. That's just how it works. If your animation is uniform... no problem. But if your animation frames change size, as most do, then you could go from not intersecting on one frame to intersecting on the next frame, and viola... your character has magically teleported to the top of the wall. You need to keep the collision box uniform to avoid this. Using a separate object as the hitbox is currently the best method to do so.

However, that's just a quirk of the Platform behavior, and just one of a few reasons why you might need to use a separate object.

If you're doing something like a space shooter or whatever, you probably won't need to use a separate object at all. It depends on what the situation calls for.

So... what's your situation?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Feb 04, 2009 8:57 pm

Thank you very much! I was mostly wondering if there were other problems than what you mentioned in the tutorial, but as the physics property seems to take care of the issue you are mentioning here, I think I will be sticking with that. I use very few frames of animation with that as is.
B
2
G
4
Posts: 49
Reputation: 1,148


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests