Hello everybody.
So I was building a 3D world, with physics commands here and there.
The object number that is in uses are
10,000
13,000
15,000
20,000
I was trying to detect which object is colliding with my player object, which is number 10,000
So I called these commands
hit = ObjectSphereCast(0,GetObjectX(playerObj),GetObjectY(playerObj)-100,GetObjectZ(playerObj),GetObjectX(playerObj),GetObjectY(playerObj)-0,GetObjectZ(playerObj),1000)
PRINT("object hit: " + STR(hit) )
PRINT("how many collision? :" + STR(GetObjectRayCastNumHits() ) )
But the weird thing is, the command PRINT("object hit: " + STR(hit) ) keeps on registering a object with number 100,001
I'm 200% sure I've never made an object with that number, or have any function that can create object with that number.
Then, I tried to delete that object 100,001 by deleting the object before i detect the collision
DeleteObject( 100001 )
hit = ObjectSphereCast(0,GetObjectX(playerObj),GetObjectY(playerObj)-100,GetObjectZ(playerObj),GetObjectX(playerObj),GetObjectY(playerObj)-0,GetObjectZ(playerObj),1000)
IF hit<100000
PRINT("object hit: " + STR(hit) )
ENDIF
PRINT("how many collision? :" + STR(GetObjectRayCastNumHits() ) )
But, somehow a new object was detected in its place, an object with the number of 100,002
When I tried to delete object 100,002, object 100,001 reappeared!
What is this object 100,001?
It's really troubling for me, because I was trying to detect what object is colliding with my character, but this object 100,001 is in the way, and I can't detect anything else reliably