"One-Way" Platform
by Robert Carroll · in TGB Platformer Kit · 11/06/2009 (5:03 am) · 2 replies
Hi Im tring to get this code to work but It won't do it evry time I go and jump up (under it) it still collides with the bottom of my scene object.
if (!isObject(PlatformBehavior))
{
%template = new BehaviorTemplate(PlatformBehavior);
%template.friendlyName = "Platform Object";
%template.behaviorType = "Platform";
%template.description = "Platform object";
%template.addBehaviorField(OneWay, "One-Way Platform", bool, 0);
}
function PlatformBehavior::onAddToScene(%this, %scenegraph)
{
%this.owner.setCollisionActive(0,1);
%this.owner.setCollisionCallback(0);
%this.owner.setCollisionPhysics(0,0);
%this.owner.isGround = true;
%this.owner.isOneWay = %this.OneWay;
}About the author
Stay Up all night playing PS3 ;) add me PSN: RCBASEBALL13.
Associate Phillip O'Shea
Violent Tulip