2D Toolkit Forum
2D Toolkit => Support => Topic started by: micky on September 05, 2013, 08:25:00 pm
-
I noticed with a top-down style game if you make a "blocking" layer, any real pushing into them and you go right though, the more speed on my translate the worse it is. I noticed changing the thickness in the inspector window makes this a little better, but I can still push through walls.
I know this issue is not specific to 2D Toolkit.
I noticed if I just put a box collider in place for a wall it works as it should, so it would be pretty amazing if there was an option to turn all of those chunks into cubes with box colliders instead of the big mesh which is iffy.
If anyone has solved this another way that they can share I would greatly appreciate it.
-
1. Look at your character controller - usually when you go through a wall its because its stepping over it... Is the y coordinate changing?
2. About creating box colliders instead - you can do this with a bit of trickery. Create a "collider" sprite. Draw it into a new layer to mark out collisions. Attach a prefab to this sprite in the data tab, and make sure you don't have the sprite on the prefab, but just a box collider. When you draw this layer and commit, you get a box collider wherever you paint your collider sprite.
-
I could push through even extremely tall meshes.. but ya, in some instances it was crashes into thin ones so hard it went over, but without rigidbody freezing those axis's, even setting a translate in the update doesnt help because its already went over by the time you can set it back.
I did do the prefab thing and that worked pretty well, just created a billion boxes though. ;p
Have you thought about putting in an option for collider thickness? When I set it via the inspector, doing and edit/commit always chnages it back.
-
You can set the thickness in the sprite collection editor (collider depth in settings).
"just created a billion boxes though" - You did ask for box colliders... :)
-
OVER 9000!!! collider boxes.... pc right? MOBILE WHAAAAAAA?!?!??! ;)