Ok so I do not know how to cast a ray properly, everytime I do my program freezes. I need to do a check in front of my 3d player and also for walking in water and the water has no collison. I am lost.
But I also need to figure out how to detect if im walking on water also. I repeat this because the function here is just for picking up objects.
What freezes my program.
+ Code Snippetfunction PickUpItems()
For x=InventoryPickUps.length to 0 Step -1
global oldx#
global oldy#
global oldz#
global newx#
global newy#
global newz#
oldx# = GetObjectX(player)-11
oldy# = GetObjectY(player)
oldz# = GetObjectZ(player)
newx# = GetObjectX(x)+11
newy# = GetObjectY(x)
newz# = GetObjectZ(x)
if GetObjectExists(x)=1
hitID = ObjectRayCast(0,oldx#,oldy#,oldz# ,newx#,newy#,newz#)
if hitID=x then print("Hit")
endif
next x
endfunction