How does one use impulse to counteract a collision impact? (and should i even do that?) #717
Replies: 1 comment
-
This is a fairly complicated topic and not really something that relates to this extension per se. I would recommend you seek advice in some of the more general Godot communities, like its new forum, its Discord or its Subreddit, as seen here. With that said, I would not recommend that you have your wheels be separate collision shapes like this, as moving them around is not going to behave well. Your best bet is probably to make a ray-cast/shape-cast based suspension, for which there's a plethora of tutorials out there for various game engines. You also have the option of making a joint-based vehicle, but those are in my limited experience quite difficult to actually make enjoyable. |
Beta Was this translation helpful? Give feedback.
-
So I'm trying to make a racing game, and part of it is a suspension simulation.
After looking at how actual car suspensions work, there's tons of nonlinear behavior, so I opted for partially custom integration.
The suspension has 2 main parts, the travel, and the force dampening. And for both of these I want to use the collision impulse.
So My initial idea is that if i take the collision impulse, invert it, and apply it in the same position, the car shouldn't move...
So I tried that and this is the result XD:
So either impulse i get from the collision is not the same as applied to the rigid body, or I'm missing something lmao.
This is an excerpt of the code that does this, note the impact position has been adjusted from global to local coordinates.
Beta Was this translation helpful? Give feedback.
All reactions