DEV Community

Maciej Sawicki
Maciej Sawicki

Posted on

[Game of Purpose] Day 34

Today I made my drone drop a granade and explode on impact.

A problem I currently face is that when the granade is attached via a PhysicsConstraint it will contribute to a drone's mass and will slowly fall down, because there is not enough thrust. I tried to add granade's mass to up/down thrust calculations, but it didn't work. :/

Another problem is that there is no easy way of disabling a connection PhysicsConstraint. You cannot simply unbind connection from a granade to a drone. You have to swap granade with something else. I tried that, but the replacement needs to have its physics enabled and I don't want it to contribute to a mass even if it's invisible.

The solution I made is unlocking the "Linear Z limit". It means that the invisible rope the granade is connected to the drone unwinds infinitely. By default all the Linear axes are locked

Image description

Top comments (0)