2D Toolkit Forum

2D Toolkit => Support => Topic started by: Dipso on March 07, 2016, 10:43:19 am

Title: Tilemap tile front collision
Post by: Dipso 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
Title: Re: Tilemap tile front collision
Post by: unikronsoftware 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.
Title: Re: Tilemap tile front collision
Post by: Dipso 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.

Title: Re: Tilemap tile front collision
Post by: unikronsoftware 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.