Collision problem
by Drethon · in Torque Game Builder · 09/14/2012 (8:23 pm) · 1 replies
I'm playing with the following code in the platformer tutorial to make movement have an acceleration and deceleration that differs between being on ground and airborne. If I put the commented out code back (basically forcing sped to velocity of 30) in a collision is detected, if I leave it commented out the collision is not detected.
Any help?
Any help?
%this.againstLeftWall = false;
%xVelocity = %this.getLinearVelocityX() ;
if ( mAbs ( 30 - %xVelocity ) < 2.0 )
{
%this.setConstantForceX ( 0 ) ;
%this.setLinearVelocityX ( 30 ) ;
}
else
{
if ( %this.airborne == true )
{
%this.setConstantForceX(5);
}
else
{
%this.setConstantForceX(50);
}
}
//%this.setLinearVelocityX ( 30 ) ;
Torque 3D Owner Drethon
Default Studio Name