- Home /
Collision causes object to fly away at high velocity
I have a game where the user can fly a ship into islands to destroy them. When the ship collides with any of my islands, the island will seem to disappear but after further investigation, I observed the island just moves extremely far away instantaneously and then stops. I've changed the mass and drag but they don't seem to be having an effect. Why is collision adding so much force?
This is the ship object This is the Island object, the mass and drag are set to 100 in the code This is a link to the apk to test out. link text
Why don t you set kinematic to be true? Do you expect the islands to actually drift away?
I don't set kinematic to be true because i want the ship to be able to collide/interact with the islands and move them around. If the player bumps into an island it should move and then decrease velocity, eventually co$$anonymous$$g to a stop, but changing the mass and drag doesn't seem to effect how far an island is pushed. Does that answer your question?
Answer by Bieere · Dec 11, 2016 at 10:19 PM
If you want collisions to occur, the ship cannot be kinematic, as that assumes you are controlling how the collisions are functioning. Change the ship to non-kinematic, and change the velocity within a fixedUpdate() if you want collisions to function how you mentioned.
Thank you, I did miss making the ship kinematic, this helped me realize that I also still had a capsule collider on my water plane, which was causing the strange effect on my islands.