Andy R Posted August 8, 2017 Share Posted August 8, 2017 Hi, i've 2 characters physics p2 enabled, they both can collide with each other, they are also static=False.Which mean that when one run toward another, the second get back and get some velocity. Which properties i've to set to get more control on this effect ? I tried editing masse/inertia but got had not good results. Any tips ? I'm also looking for an equation that show how the effect works depending on theses parameters. Thx Link to comment Share on other sites More sharing options...
Tom Atom Posted August 9, 2017 Share Posted August 9, 2017 Static objects should not collide as they are ... static. Static are two houses on street - it does not move. For moving objects in game physics (not only P2) you have two choices: - kinematic body, - dynamic body. Kinematic body is good for things like moving platforms - it moves, but when player jumps on it it does not react and still makes its work. Dynamic bodies are what you need when you want action-reaction behaviour. Now, you can set its mass and other properties to tune your game. Regarding equation, this is good source: http://chrishecker.com/Rigid_body_dynamics and equation you are looking for is in part 3: http://chrishecker.com/images/e/e7/Gdmphys3.pdf Link to comment Share on other sites More sharing options...
samid737 Posted August 9, 2017 Share Posted August 9, 2017 I think restitution will control the bounciness of objects: The damping in the example sets how much to slow down over time (p2 version of drag). You can tweak individual objects using contactMaterials. The details in the wiki shows which parameters are involved (mass and velocity). Link to comment Share on other sites More sharing options...
Andy R Posted August 9, 2017 Author Share Posted August 9, 2017 @Tom Atom yes i meant static=false sorry edited my post thank for your answers i ll check them back home ! Link to comment Share on other sites More sharing options...
Recommended Posts