Game Development Community

Collision layers in datablocks?

by Roland Wang · in Torque Game Builder · 07/09/2009 (9:50 am) · 2 replies

As far as I've seen you can't enter multiple layers into the CollisionLayers field in a datablock, you can only enter one integer that gives an arrangement of collision layers.

Am I doing something wrong or is it supposed to function like that? And is there a reference source for which integers correspond to which layers? I'd rather not keep guessing until I get the right arrangement.

About the author

Recent Threads

  • Triggers

  • #1
    07/10/2009 (10:03 am)
    It's supposed to work like that. The collision layers field is interpreted as a binary number. So if you inputted "-1" in the CollisionLayers field, you would turn on collision for all the collision layers since -1 translates to 111111.. in two's complement (which I assume is being used).

    Another thing you can do is something like this:

    BIT(0) | BIT(2) | BIT(3) | BIT(5) | BIT(10)

    Which will create the integer you are specifically looking for.
    #2
    07/10/2009 (11:08 am)
    Oh awesome I didn't know it was a binary. That helps a lot.