Hello Guest

Author Topic: Tilemap tile front collision  (Read 4678 times)

Dipso

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Pure Fun Games
Tilemap tile front collision
« on: March 07, 2016, 10:43:19 am »
Hi

Is there a way to set the front collision for a tile (i.e. collision plane with a normal facing towards the camera)?

Currently, collision is added to the sides of the tiles.
But if you make a top-down game there seems to be no way to set the collission for the "ground".
So a physics object falling from the sky (towards the tilemap/ground) collides with the ground.

Diorgo
Pure Fun Soccer brings arcade action to your iPhone, iPad and iPod touch.
Try out the free Lite version: https://itunes.apple.com/us/app/pure-fun-soccer-lite/id533048090?mt=8
Blog / Portfolio: http://www.diorgo.com/

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap tile front collision
« Reply #1 on: March 09, 2016, 11:20:17 am »
Hi, you can get front and back faces if you use 3D colliders and turn on front and/or back caps.

Dipso

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Pure Fun Games
Re: Tilemap tile front collision
« Reply #2 on: March 10, 2016, 11:37:33 am »
Thanks for the feedback :)

Suggestions for future updates (low priority):
A way to set the collision plane offset for front and back faces.
Currently it positions the front and back equal distance from the tile (so the tile is in the middle).

For example: To be able to tell it to position the front zero distance from the tile, and the back 1 unit behind the tile.

Would also be nice if the collider depth can be set on a per tile basis. This can be optional per tile and overrides the Sprite Collection's default collider depth.

Pure Fun Soccer brings arcade action to your iPhone, iPad and iPod touch.
Try out the free Lite version: https://itunes.apple.com/us/app/pure-fun-soccer-lite/id533048090?mt=8
Blog / Portfolio: http://www.diorgo.com/

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap tile front collision
« Reply #3 on: March 14, 2016, 11:10:15 pm »
Hi there,

Its easy enough to have different front and back distances, but per tile would be far more complicated - as it would open up the model and would need sealing up from the X and Y planes. It'll make sense if you imagine 1 1deep tile next to a 3 deep one, the inside face will need filling. It'll be easier to write a pooling collider system that can spawn box colliders dynamically - it'll be a lot easier to maintain and a lot quicker to update too.