The missing the collision and going forever thing was a problem for me, so i devised a code such as:
`**********************************
`Object Creation and screen setup
`**********************************
autocam off
position camera 0,100,-800
point camera 0,0,0
set camera fov 24
sync on
sync rate 60
objID = 1
make object sphere objID, 20,16,16
position object objID, 0,50,0
objSpeed# = 2.0
color object objID, rgb(255,0,0)
make object plane 100, 100,100
color object 100, rgb(0,255,255)
rotate object 100, -90,0,0
set object collision on 100
position object 100, 0,-50,-20
`**********************************
`Main loop
`**********************************
DO
X# = OBJECT POSITION X(objID)
Y# = OBJECT POSITION Y(objID)
Z# = OBJECT POSITION Z(objID)
currentYstate# = gravityCHK(objID, X#,Y#,Z#, objSpeed#)
POSITION OBJECT objID, X#, currentYstate#, Y#
SYNC
LOOP
`**********************************
`Gravity Function
`This function takes the object, x position, y position, z
`position, and drop rate and sorts out the height the collision
`occurs. It then returns the Y position.
`**********************************
FUNCTION gravityCHK(objTOcheck as INTEGER, objX# AS FLOAT, objY# AS FLOAT, objZ# AS FLOAT, objDropRate# AS FLOAT)
Grounded = 0
FOR GravCheck# = 0.0 TO objDropRate# STEP .01
POSITION OBJECT objTOcheck, objX#, objY#-GravCheck#, objZ#
IF OBJECT COLLISION(objTOcheck, 0) > 0
Grounded = 1
ObjYsender# = object position y(objTOcheck)
gravityPlacement# = ObjYsender#+ GravCheck#
ENDIF
NEXT GravCheck#
IF grounded = 0 THEN gravityPlacement# = objY# - objDropRate#
ENDFUNCTION gravityPlacement#
Basically, when something is 'falling', it drops it on a much smaller scale in a FOR NEXT statement and grabs the initial moment that it connects.
I'm not sure if this code meets up with standard coding practices, but hopefully it gives an idea as to how i solved this dilemma.