Default collision response not working with tilemap
by Alex Rice · in Torque Game Builder · 09/17/2005 (10:33 pm) · 4 replies
Using StaticSprites, I have the default collision response working. So even though I have not implemented fxSceneObject2D::onCollision I can still get physics collision and response, which is great.
However it does not seem to be working with a tilemap even though the tiles have the collision active flag set. The engine is outlining the tiles with BIT#5 Object Collision Polygon
So why no collision response?
I know I can implement fxSceneObject2D::onCollision and write my own response but that's not my intent yet.
Thanks in advance.
However it does not seem to be working with a tilemap even though the tiles have the collision active flag set. The engine is outlining the tiles with BIT#5 Object Collision Polygon
So why no collision response?
I know I can implement fxSceneObject2D::onCollision and write my own response but that's not my intent yet.
Thanks in advance.
About the author
#2
09/18/2005 (8:56 am)
Have you enabled collision on the tile layer? You have to call setCollisionActive(false, true) an each tile layer that you want to have collisions.
#3
09/18/2005 (9:24 am)
Have you made sure your bitmasks are set correctly?
#4
@Hugeone just checking off "collision active" in the tile map editor is not sufficient, like Hugeone said [edit: like Adam said] you also have to call setCollisionActive(false, true) on the tile layer itself, in your script. Seems like a bug w/ the tile map editor, but lot of times Melv really has good design decisions for this stuff .
@LoTekK - I'm not using any group masks for my collisions.
thanks all
09/18/2005 (9:29 am)
@Adam- Yes! I knew it had to be something simple. @Hugeone just checking off "collision active" in the tile map editor is not sufficient, like Hugeone said [edit: like Adam said] you also have to call setCollisionActive(false, true) on the tile layer itself, in your script. Seems like a bug w/ the tile map editor, but lot of times Melv really has good design decisions for this stuff .
@LoTekK - I'm not using any group masks for my collisions.
thanks all
Torque Owner Hugeone
I want to know how to do it , please give us a suggestion, thanks a good expert.