I have a Player and Box that are both Dynamic bodies, and a "water volume" that is a Sensor
I have written some water bobbing code (using applyForce()) so when the Player and Box land they bob up and down - and im quite happy with it.
When my Player jumps on the Box, the Box sinks a bit before the buoyancy kicks in, however when my player moves Left/Right the Box is pushed as well.
This doesnt happen when my Box is not in the water volume, and my Player runs on top of it.
Is there something I can do to fix/cheat this at all? Perhaps I'm tired and missed something obvious...
Cheers for any help!
Box in water moves when Player moves
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Box in water moves when Player moves
Hard to say without looking at the love file, but it sounds like this is related to mass and friction.
Try to set the mass of the box to be considerably greater compared to that of the player.
Massive objects are harder to push around compared to light objects.
Alternatively you could try lowering the friction for both objects.
Try to set the mass of the box to be considerably greater compared to that of the player.
Massive objects are harder to push around compared to light objects.
Alternatively you could try lowering the friction for both objects.
Re: Box in water moves when Player moves
Hey ivan, cheers. I had tried changing the Mass/Density - but the Box would sink quite quickly. However mixing that with lowering Friction of the Box seems to have worked.
Thanks!
Thanks!
Re: Box in water moves when Player moves
Ah, it seems I have to lower the Friction a bit too much - and my Player picks up too much speed now when walking across
I guess I could make it heavier than player and adjust my water buoyancy code relative to that
I guess I could make it heavier than player and adjust my water buoyancy code relative to that
Re: Box in water moves when Player moves
Other ideas:
You could try to add some kind of viscous friction of the box with water too. That would be a force that opposes the movement of the box with respect to water and that grows with velocity (horizontal in this case).
Another idea is to apply reaction to the box: a force opposed to the one you apply to the player. As your player walks on the box, the shoe of the player exerts a backwards force on the box.
You could try to add some kind of viscous friction of the box with water too. That would be a force that opposes the movement of the box with respect to water and that grows with velocity (horizontal in this case).
Another idea is to apply reaction to the box: a force opposed to the one you apply to the player. As your player walks on the box, the shoe of the player exerts a backwards force on the box.
Who is online
Users browsing this forum: No registered users and 47 guests