Hello Guest

Author Topic: TileMap - option for Box Colliders based on tiles instead of Mesh Colliders  (Read 4905 times)

micky

  • Newbie
  • *
  • Posts: 23
    • View Profile
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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TileMap - option for Box Colliders based on tiles instead of Mesh Colliders
« Reply #1 on: September 06, 2013, 02:24:39 pm »
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.

micky

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: TileMap - option for Box Colliders based on tiles instead of Mesh Colliders
« Reply #2 on: September 06, 2013, 05:42:56 pm »
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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TileMap - option for Box Colliders based on tiles instead of Mesh Colliders
« Reply #3 on: September 07, 2013, 09:18:07 am »
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... :)

x8105

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: TileMap - option for Box Colliders based on tiles instead of Mesh Colliders
« Reply #4 on: September 08, 2013, 08:37:07 pm »
OVER 9000!!! collider boxes.... pc right? MOBILE WHAAAAAAA?!?!??!   ;)