#### Archived

This topic is now archived and is closed to further replies.

# Repelling Force ?

This topic is 5392 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi guys, I''m trying to make a robust repelling force in my dodgeball-like game. I apply the force in the direction from the force point to the object, which causes acceleration in that direction; pretty basic stuff. It doesn''t work that great though. If the moving object is approaching it slowly it bounces off like it hit an invisible rubber bumper, and if it''s moving quickly it can pass right though. If I apply less force (acceleration) the slow objects repell nicely but the fast objects aren''t really affected, and if I apply a stronger force to repell the faster objects the slower ones bounce off abruptly. Maybe I should apply a force proportional to the incoming velocity of the object ? Then would it matter if the object is heading towards or away from the force ? I experimented a lot and can''t get it right. Any ideas ? Thanks.

##### Share on other sites
Tou could make the force dependent on distance, like 1/x or something.

##### Share on other sites

Basically, the object which is travelling along...has a certain amount of energy ( Im sure you know this already. Its probably me just wanting to explain things ). When it hits something, the collision is gonna decrease the ammount of energy it has right?

When the object hits something, most of its kenetic energy goes into deforming its shape ( the squish ) and is stored up, kinda like stretching an elastic band. There is a little bit of energy however lost through sound and heat ( this is important ). When the object is no longer moving, the energy it has stored up by changing shape is then converted back into kenetic energy (let go of said elastic band), in the direction off the wall it hit for example, and it flies off to have more bouncing fun.

Its the energy thats lost, that makes the object bounce less and less the more collisions it has.

Er.........Yea :D

Hope that helped a little.

##### Share on other sites
You can try reflecting the velocity about the normal of the surface that it is hitting.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633297
• Total Posts
3011249
• ### Who's Online (See full list)

There are no registered users currently online

×