Making an object gain momentum from a collision (2D)
Hello all,
Been searching around for about an hour for an answer to this, but can't seem to find anything. (mostly people with the opposite problem...)
I have two objects; The first object is spawned on a player action. It's a box collider and has a rigidbody, and a script which makes it move quickly to the right before destroying itself.
The second object is a minecart-type thing, which is a box collider/rigidbody, and two children which are circle colliders/rigidbody, and hinge joints (I don't want any suspension or anything so this made more sense than wheel?)
If I put the cart on a slope, it'll happily roll down with the wheels spinning away. However, if I make my first object hit it, the first object pushes it along until the moment it destroys itself. Then, the cart immedietely stops.
I want the cart to keep its momentum after the pushing object is destroyed - it should roll a bit before coming to a stop basically. How can I achieve this? I'm pretty new to Unity, but from my understanding this seems to be more of a settings/components thing than something that requires a script. I'm comfortable with scripting, but if it's possible through the components system I'd much rather use that.
Thanks!
EDIT: Solved-ish. Turns out it was the hinge joints causing the problem - the wheels weren't turning at all when force was applied which is why the momentum wasn't lasting. Now I just have to get to a point of having zero suspension, currently its ok sometimes but other times the wheels completely freak out and go all over the place but I can work with this :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613004419im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Collision Detection on Rb with Interpolation and Rb with Extrapolation does not work the same way. 0 Answers
Stop Force on Collision 0 Answers
a chain of 2d collision problem ( object going trough other ) 0 Answers
Destroying object on any collision 1 Answer
Arkanoid in Unity - Dealing with collisions between ball and paddle 0 Answers