"Uniy 2D Beat 'Em Up, how to do collision?" (93834)

Hi there. I am currently working in a 2D beat 'em up using Unity 4.3 Native 2D tools. I am basing my game on Castle Crashers and I am completely stumped on how to do collision like they do. Any help will be much appreciated. Thank You.

Can you explain what kind of collision you want without refering to another game? Or at least link to a video and say at which time one can see what you mean.

Yes. [Here's the gameplay video.][1] At 2:40, you can see that players start moving and go down the stairs, however, they can also fall down the ledge below. This is what I am looking to do. [1]: http://www.youtube.com/watch?v=ltRtERCbbvo

1 Answer

1

If you want to stay 2D, I would define walkable Trigger-PolygonColliders.

Those Polygons also have walk vectors assigned to them, this way the game knows when I enter the stairs polygon and I press right, I actually go down the slope. The dark blue vector is the same for up/down.

If I walk off a polygon and not on another, I just fall, till I hit another polygon - this way you can let yourself fall off the ledge or the side of the stairs - you simply fall down till you hit another walkable polygon.

There are also Polygons that you can’t enter for stuff you need to go around, like the foot of the archway or the wall in the background.

For all of these collisions and triggers only small colliders(yellow dot) at the feet of the players are used, so they can walk up to a wall etc.

All things are drawn in layers based on their fake depth, so the archway is rendered in front of the players etc.

[21126-6zqxc71[1].png|21126]

First of all, thank you so much for taking time to explain so detailed as well as making an image. What do you mean by "walk vectors"?

concerning the hit detection of the weapon... how do you keep it dynamic (following the weapon)?

What about jump and stand on a box?