![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Aster |
I am trying to rotate a kinematic body and then check if the body is colliding using the move_and_collide() function, with ‘test_only’ as false. However, whenever i attempt to get collision information, it returns an ‘invalid get index’ or ‘null instance’ error (depending on how i’m getting this information)
Here is the code:
func _physics_process(delta):
CNTRL() #does the movements and stuff
var testcol = move_and_collide(Vector3(0, 0, 0.1), false, false, true)
if testcol.testcol.collider().get_collider_id() == "world": # if colliding with the object (in theory)
print("colliding") #return
From what i’ve read everywhere else, i’m not doing anything wrong. Wondering if maybe i’ve messed up some syntax? Used .collider() and .collider so i dont think its that though.