hovering a ship

Blitz3D Forums/Blitz3D Beginners Area/hovering a ship

Well, you do a line pick straight down.

LinePick x,y,z,0,-10,0 ; make the line pick start from x,y,z, and go down 10 units on the z axis. [EDIT] STUPID MISTAKE FIXED

Now, you need to make the mesh you want to hover above PICKABLE, which means setting an "entitypickmode" for it. Or else the linepick won't collide with it.

Now, once you've done your line pick, check that PickedEntity <> 0 , meaning that something has actually been detected by the linepick.

Now, contained within PickedX(),PickedY() and Picked(Z), are the co-ords of where the collison occured. Your only looking for the height, so only PickedY() really concerns you. Simply subtract the PickedY() from the start co-ords of your LinePick, to get the height above the collision, your ship is.

Hope that helps you :o)