Two rigidbodies collide, one gets shot to the side #750
-
Hello, I thought it might be a bug on my code but after reviewing my code multiple times I can't seem to figure out what might cause this, so I'm hoping you might be able to enlighten me as to what could cause this, if that's okay. I have two bodies, one that is controlled by the player, and another that's not. They're supposed to collide with each other but not move, which was the behaviour thus far. Their settings are:
So the behaviour is as soon as the player controlled body interacts with the other body, it'll get thrown to the opposite direction at a high speed. I've already checked that setting the body to Static solves the problem, but I'd like it to be dynamic. I would love it if you could give me some hints on what might be causing this, and I do apologise for making an issue about it rather than fix it myself, but I've already spent hours trying to figure this out and I could use some hints. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello, I don't know what it is given the info in this ticket. Can you maybe make a repro case by modifying one of the tests in the Samples to show what is going wrong, e.g. by replacing the code here? |
Beta Was this translation helpful? Give feedback.
-
Hello, it seems that this was caused by me not making one of the bodies static. However, I think it's strange that two dynamics colliding sends one moving in the opposite side, never really stopping. Is this normal in a zero-gravity situation, when there's no walls or floors? Thank you very much for your time. |
Beta Was this translation helpful? Give feedback.
-
It's hard to say if what you're seeing is normal or not since you didn't provide a video or repro. In general Newtons first law says that things will keep the same velocity in absence of external forces, so yeah an object should keep moving forever in the same direction after collision in zero g conditions. |
Beta Was this translation helpful? Give feedback.
It's hard to say if what you're seeing is normal or not since you didn't provide a video or repro. In general Newtons first law says that things will keep the same velocity in absence of external forces, so yeah an object should keep moving forever in the same direction after collision in zero g conditions.