Quote: "how do i use the id that i fetch later on...i think i ever tried but it return 10k(?) value to me but it dont mean anything to me.."
Create your object in a type and give it a name like I showed you above, get the object (10k) id from the ray cast function and send it to the GetItemName
a more complete example
Type myItem
object_id
name as string
EndType
Global myHealth as myItem[100] // 100 health packs
Global myDoor as myItem[10] // 10 doors
Global myBox as myItem[10] // 10 boxes
Function GetItemName(typ as myItem[], object_id)
for index=0 to typ.length
if typ[index].object_id=object_id
ExitFunction typ[index].name
endif
next
EndFunction ""
Function CreateBox(typ as myItem[], name as string, width, height, length)
tmp as myItem
tmp.name=name
tmp.object_id=CreateObjectBox(width, height,length )
typ.insert(tmp)
EndFunction ""
CreateBox(myBox, "box1", 100, 100, 100)
CreateBox(myBox, "box2", 100, 100, 100)
CreateBox(myBox, "box3", 100, 100, 100)
CreateBox(myBox, "box4", 100, 100, 100)
CreateBox(myBox, "box5", 100, 100, 100)
object_id = GetObjectRayCastHitID(0)
if GetItemName(myBox, object_id) = "box3"
the raycast hit "box3"
endif