Page 1 of 1

Friction

PostPosted: Sun Jul 03, 2005 1:30 pm
by ondy1985
Hello everyone.

Is there a way I can simulate friction in GE? Let's say I want to make a soccer viewed from above and I want the ball to lose speed after it's been kicked so it would stop smoothly. Any ideas?

EDIT:
One more thing: you don't know the angle the ball has so the directional_velocity can't be used.

PostPosted: Sun Jul 03, 2005 3:21 pm
by Game A Gogo
Code: Select all
directional_velocity *= 1;

if ( directional_velocity < 0.1)
  directional_velocity *= 0.75;


In DrawActor envent, it should work

PostPosted: Sun Jul 03, 2005 6:30 pm
by ondy1985
No, I can't use 'directional_velocity' variable because it's equal to zero so there's nothing to decrement. The 'angle' variable is zero as well.

Ball movement is forced by Physical Response action after a collison. But I think xvelocity and yvelocity should be nonzero so I'll just decrement each of them by a constant each time the actor is drawn. Gonna try.

PostPosted: Mon Jul 04, 2005 2:39 pm
by makslane
You can use the directional_velocity without problems.