Balls Speeding up in Physics Engine?

Hi everyone,

I’ve been trying to create an animation where 5 balls in a room begin rolling around and speeding up (as though they had an internal engine propelling them), all the while bumping into each other and into the walls of the room.

Any idea how to do this?

(One way that would address this perfectly and easily would be if I could set friction with the ground to a negative number, in which case friction would be the force actually pushing the balls forward… but that’s just an idea.)

You could have velocity increase counter. It will stop at the object’s max velocity. You could always increase the max velocity of said object(s) while the velocity counter is still going.

ok cool! but where is this “counter” located?

thanks again!

I personally would rather python code it then use logic bricks.

I have this code in my always sensor pointing to my python script

``````if 'Health' not in player:
start(player)

if keyboard.events[bge.events.WKEY] == JUST_ACTIVE:
if player['Velocity'] &lt; player['maxVELO']:
player['Velocity'] += .25
if keyboard.events[bge.events.SKEY] == JUST_ACTIVE:
if player['Velocity'] &gt; player['minVELO']:
player['Velocity'] -= .25

def start(player):
print('Creating variables...')
player['Health'] = 100
player['Velocity'] = 0.0
player['maxVELO'] = 100
player['minVELO'] = player['maxVELO'] * -1
player['rotSPEED'] = 0.0
player['onGround'] = False
player['Counter'] = 0
``````

So it break it down, it object (player) not created, create it with the DEF START (passing object in). I set the Max / Min velocity and then it goes back to the always cycle (top of the code) which increases the velocity until max velocity is created. If you hit your velocity and wanted to increase it later, you would simply need to set the new max velocity via

`````` player['maxVELO'] = 1000 (any number variable)
``````

then the if statement will be hit (100 is under 1000) and it wil continue

this should be deleted. cant find how