Game Development Community

Switch and Door Behavior

by Matt Van Gorkom · in TGB Platformer Kit · 07/29/2008 (10:37 am) · 1 replies

Has anyone developed behaviors to control doors/bridges/lights from a switch? Just thought I'd check before I attempt it.

#1
07/31/2008 (1:49 pm)
I would think you could just drag a trigger into your scene, then in the onEnter callback for that trigger, add

objectName.Visibility = true;
objectName.setCollision(true);

where objectName is the name you give the door/bridge/light in the scripting dropdown menu.

I don't have TGB on this computer, so I can test, but you should get the idea from that.

'Patrick