Hi! I cant make ray cast work.This simple code is from official examples.
sync on
sync rate 60
autocam off
position camera 0, 50, -100
point camera 0, 0, 0
make object box 1, 100, 10, 100
position object 1, 0, -5, 0
color object 1, rgb(255, 0, 0)
DYN START
DYN MAKE BOX 1, 0.0
rayPosVec = 1
rayDirVec = 2
x = make vector3 (rayPosVec)
x = make vector3 (rayDirVec)
set vector3 rayPosVec, 0, 20, 0
set vector3 rayDirVec, 0, -20, 0
DYN SIMULATE
do
DYN FETCH RESULTS
DYN DEBUG RENDER
DYN UPDATE
rayHit = DYN RAYCAST ANY SHAPE(rayPosVec, rayDirVec, NX_ALL_SHAPES, -1)
if rayHit
center text screen width() / 2, y, "RAYCAST ANY SHAPE HIT... OBJECT: UNKNOWN"
endif
DYN SIMULATE
sync
loop
DYN FETCH RESULTS
DYN STOP
Here i use simple box but raycast doesn't work with comlex objects also.