Game Development Community

Change a layer in code

by Christopher Ellis · in Torque Game Builder · 03/13/2009 (5:01 am) · 2 replies

I've been trying to make an object that starts off not able to collide with either group or layer zero, then upon mouse click is able to. I haven't been able to figure out how to change either the collision groups/layers list, or the group/layer of the object.

I feel like I must be missing something pretty simple here.

Thanks in advance.

#1
03/13/2009 (5:12 am)
Missing something simple is right.

http://tdn.garagegames.com/wiki/TGB/Reference:_t2dSceneObject_Spatial_Methods#setLayer.28.25layer.29

Every t2dSceneObject has a method called "setLayer".
#2
03/13/2009 (5:27 am)
*heavy sigh*

This is what I get for working until 8 in the morning. I was using %this instead of %this.owner

Thank you for confirming that "setLayer" was right though. Never would've figured it out without that.

Now that it works, I can finally sleep.