fenomas / noa

Experimental voxel game engine.
MIT License
611 stars 87 forks source link

Fluid physics #103

Closed Roy-Ermers closed 4 years ago

Roy-Ermers commented 4 years ago

I can't seem to work out how players can float in fluids. I've looked at examples in your code but still the player sinks to the bottom of the sea. There is some fluidDrag but it is not enough. Any ideas how to fix this?

fenomas commented 4 years ago

Hi, I'm guessing you want to increase the noa.physics.fluidDensity property, or alternately decrease the player entity's mass. Whether an entity sinks or floats is down to whether it's more or less dense than the fluid it's in, and while entities have no explicit density property, you can make the player less dense by decreasing the entity's mass (or making it larger without changing the mass).

Roy-Ermers commented 4 years ago

Hey thanks for the response, turns out i forgot to set the playerheight and width!