Game Development Community

So, how to enable tilemaps collisions ?

by Eugene Karnot · in Torque Game Builder · 12/23/2008 (1:07 pm) · 3 replies

Subj.
I can enable the checkbox it tilemap editor, and enable receive collisions (but it wont let me check send collisions checkbox) checkbox in tilemap properties, but my collision test object just moves through tilemap without any reaction whatsoever.

#1
12/23/2008 (4:45 pm)
Hi Eugene,
I'm a TGB newbie, but I might be able to help. Let's double-check the basic items first...

1. You have Receive Collisions checked, one down!

2. Do you have Send Collisions checked on the object that's colliding with your tiles?

3. Is the tilemap's collision enabled for the collider's collision group or layer? (Ugh, messy sentence. In other words, if your Breakout ball is on Layer 1, and your brick tilemap is on Layer 2, is Collision Layer 1 selected for the tilemap so it can receive the Layer 1 ball's collision info? By default, all layers and groups are selected, so this probably isn't the issue for you.)

4a. Did you set up a collision polygon for each tile type?
4b. When you painted your tilemap, did you have the Collision checkbox checked?

To verify those last two items, look at the scene properties (click on an empty part of the screen and hit the Edit button). Expand the Debug Rendering section, and check the Collision Bounds checkbox. If your tiles have collision information, their boundaries will be shown in green. If it looks exactly the same as before you checked the box, you need to add a collision polygon to your tiles.

To add a collision polygon, edit your tilemap, click the paint icon, and select your frame. When the Collision box is checked, the tile preview should have green lines surrounding it. If not, or if there's only a single green dot, you'll need to add points to that preview by clicking on the corners. Then, repaint the affected brushes, making sure the Collision checkbox is marked.

Okay, chew on that for a while, and let us know if that solved the problem. =)
#2
12/23/2008 (11:16 pm)
Yes, all these steps are done, but when i have object follow of flee the mouse - nothing tells me of any collisions happening. For my test object i use "follow mouse ex" behaviour from demos, which says, and i quote, "will obey collisions", except it doesnt.
#3
12/24/2008 (6:57 am)
Okay, so apparently collision detection only works if i turn on physics send/receive as well. I mean, what the... In all the tutorials they tell you to always turn physics off, and who would have thought that its actually required to turn it on...