this is the full code (taken from the examples folder) including the 2 lines that should display the raycast length and y hitpoint
` this is a simple demonstration of ray casting
` set up the program
phy start
autocam off
sync on
sync rate 60
color backdrop 0
position camera 0, 20, -70
rem stripe textures
load image "stripe5.png",8
make object sphere 8,400,48,48
texture object 8,8
scale object texture 8,6,6
set object cull 8,0
load image "stripe6.png",1
` create some objects
make object cube 1, 5
position object 1, 0, 0, 0
phy make rigid body static box 1
make object cube 2, 5
position object 2, -15, 0, 0
phy make rigid body static box 2
make object cube 3, 5
position object 3, 15, 0, 0
phy make rigid body static box 3
make object cube 4, 5
position object 4, 0, 20, 0
make object box 5, 1, 15, 1
position object 5, 0, 15, 0
texture object 4,1
texture object 5,1
` show Dark Physics logo
load image "logo.png", 100000
sprite 1, 0, 600 - 60, 100000
` main program loop
do
` display information
set cursor 0, 0
print "This program demonstrates ray casting in action"
print "The ray casting is taking place from the object at the top of the screen"
print "When it hits an object that object turns blue"
print "Use the arrow keys to move the position of the ray cast left and right"
` set all objects to black
for i = 1 to 3
color object i, 0
next i
` get the position of object 4
x# = object position x ( 4 )
y# = object position y ( 4 )
z# = object position z ( 4 )
` cast a ray down
value = phy ray cast all shapes ( x#, y#, z#, 0, -1, 0 )
` if the ray hit something then colour that object blue
if phy get ray cast hit( )= 1
color object phy get ray cast object ( ), rgb ( 0, 0, 255 )
text 0,100,str$(phy get ray cast distance() )
text 0,116,str$(phy get ray cast hit point y() )
endif
`move the ray cast left
if leftkey ( )
move object left 4, 0.4
move object left 5, 0.4
endif
` mvoe the ray cast right
if rightkey ( )
move object right 4, 0.4
move object right 5, 0.4
endif
` update the simulation and screen
phy update
sync
loop