Game Development Community

Friction slowing down my player even when cero

by Adam Johnston · in Torque Game Builder · 10/07/2005 (1:28 pm) · 5 replies

Hi, I've been able to put a so so Mario like
platform game. I can make my player walk over the
tiles but when he is moving sometimes he loses speed
and stops even when I'm pressing the left key:

I'm using:
playerMap.bindCmd(keyboard, "left", "circleGuyLeft();", "circleGuyLeftStop();");
and
function circleGuyLeft()
{
	$player.playAnimation(circleGuyWalkLeft);   
	$player.setLinearVelocityX (-45);
}

function circleGuyLeftStop()
{
	if ($player.getLinearVelocityX() < 0)
	{
		$player.setLinearVelocityX (0);
		$player.playAnimation(circleGuyStandLeft);
	}
}
as materials I set the friction to CERO,
// --------------------------------------------------------------------
// Immovable Collision Material.
// --------------------------------------------------------------------
datablock fxCollisionMaterialDatablock2D(immovableMaterial)
{
	friction = 0.0;
	restitution = 0.0;
	relaxation = 0.5;
	density = 0.01;
	forceScale = 0;
	damping = 0.0;
};
// --------------------------------------------------------------------
// Standard Collision Material.
// --------------------------------------------------------------------
datablock fxCollisionMaterialDatablock2D(standardMaterial)
{
	friction = 0.0;  // <<< CERO!
	restitution = 0.0;
	relaxation = 0.5;
	density = 0.01;
	forceScale = 1;
	damping = 0.0;
};

I don't understand why the player is still slowing down
Can someone give advice about this?

It seems this problem only happens when the movement is in
the left direction.

#1
10/10/2005 (1:20 pm)
I've ben playing with the values but this weird behavior still continues.
Somebody has experienced this before?
#2
10/10/2005 (3:26 pm)
@Adam,

I think this has something to do with a bug where the tile seams somehow slow you down. Somewhere in the forum I think they are fixing it in some patch I think, if I remember correctly.
I have the same experience. Moving right is not a problem. Moving left will make my guy slow down to a complete halt.
#3
10/10/2005 (3:35 pm)
@Danny: Could you remember some keyword to search the forums? I've found many fixes
but don't know what are you talking about.
#4
10/10/2005 (4:15 pm)
I applied the tile hitching FIX of Ray "Noolness" and it seems is working now :)
#5
10/10/2005 (5:58 pm)
Yay! Thanks for the info. I saw your posting on Ray "noolness"'s thread.