Pagina's

Monday, 28 October 2019

Whatever floats your apple

Good morning. I'm keeping this one short for an injury in my hand that kept my development time short last weekend. All I did was edit the world object script to allow for objects to float on water. It works, but with some funny stuff that I yet have to fix.


We're standing on the edge of a lake with a shore line animation moving in the bottom. On the shore are done trees and there's some red little balls on top of the water. Apple.floats is true.  Now there's a problem. The trees spawn the apples and sometimes they fall on a slope and start rolling downhill. Once they hit the water, they stop going down, but they do go forward quite quickly.

Nothing it's stopping the apple from reaching across the pond and bouncing off the edge. It's not so very visible on this gif, but that could turn really weird until the apples have so much speed that they launch through the terrain into oblivion.

Having a thing to stop them is the priority here, so I did a little experimenting with drag on the rigid body component. For now, that either stops the apples too quickly or too slowly. I probably need the drag to catch the apple in the first place and then leave it again.  The catching will take away most of the speed and the release would allow the apple to keep drifting a bit.

Another possibility is to completely catch the apple and stop it and then later add movement to it in relation to wind speed and direction. Need to think that over.

No comments:

Post a Comment