hovering a ship

Blitz3D Forums/Blitz3D Beginners Area/hovering a ship

Okay here is a thought now. I now have got my ship to hover correctly :) For which I am VERY greatful. But now the gravity function that was in place that helped my ship fall gently to the ground after leaving a hill doesn't work :(

I tried this:

sx#=EntityX(ship,True)
sy#=EntityY(ship,True)
sz#=EntityZ(Ship,True)

LinePick sx,sy,sz,0,-20,0

If PickedEntity()<>0
	If sy<=dist_above_ground Then
		PositionEntity ship,sx,PickedY()+dist_above_track,sz
		AlignToVector ship,PickedNX(),PickedNY(),PickedNZ(),2,0.5
	EndIf
EndIf

	realspeed=speed/10
	MoveEntity ship,0,0,realspeed
	TranslateEntity ship,0,GRAVITY,0


But now while the gravity works and the aligning to the shape of the track works, the ship is once again in the middle of the track and flying through it :( :( :( Why is this? I am assuming that the gravity always tries to land the object to 0 height and not 10 (as the dist_above_ground is set to).

How do I sort this out? I thought the If-Then statement would solve that. Sorry, this will hopefully be the last question for a while...

Max