#Simulate top-down moveables boxes

1 messages · Page 1 of 1 (latest)

half wasp
#

This is what the player model and box itself looks like

#

This is my current attempt at mimicing the force applied on the box itself

#

And this code from the player should trigger that

half wasp
#

help, anyone? 🥲

deft heart
#

What happens if you apply the impulse from the center of the target body?

half wasp
deft heart
#

I think that is just the physics working as intended then.
If you apply force to an object off its center of mass, it will rotate.

You can increase the inertia of the RigidBody to reduce how much it rotates. Altho it is supposed to be calculated automatically based on size and mass.
Changing the mass may work better.

half wasp
#

Well, if I apply force from its center, it will now move. However, I also want to be able to hit it from a corner, and it moves as well as rotates accordingly.

deft heart
#

It doesn't move NOW, right? You said it did move when applying it to the center.

If it doesn't, it may be that you set the mass too high.

half wasp
#

When I use the apply_central_impulse method, it moves. But it also moves, when I use the apply_impulse method.

The problem is, that it does not spin correctly. For example. When I its rotated the exact same direction that the tank is, it just rotates slowly, even though there should be no such rotation force