See if this helps.
SuperGlue=directionalvelocity
VirtualPerpetualMachine=0
Your are looking for something in between these two to bleed off the directionalvelocity of the ball until reaching a zero velocity at which the ball comes to rest.
COF of ball on Grass=.05
COF of ball on Concrete=.01 'Ball would roll much easier on concrete and for a further distance.
- Code: Select all
'Check velocity of ball so you don't evaluate it if it is at rest.
'Use this in ball collision with grass area.
if(directionalvelocity!=0)
{
directionalvelocity-=.05;
}
'Use this in ball collision with concrete area.
if(directionalvelocity!=0)
{
directionalvelocity-=.01
}
This hasn't been tested, and would probably work better if you set a variable to a value when ball was colliding with different surfaces, and use the above code to evaluate it along with check for 0 velocity. Then you could place the code in the draw actor event where it needs to be actually.
Define a variable ballinfriction
Set value of ballinfriction to 1 for grass, 2 for concrete in the collisionevent of grass and concrete.
DRAWACTOR event of ball:
- Code: Select all
if(ballinfriction==1 && directionalvelocity!=0)
{
directionalvelocity-=.05;
}
'Use this in ball collision with concrete area.
else if(ballinfriction==2 && directionalvelocity!=0)
{
directionalvelocity-=.01
}