How to get the node of the object i collided with ? (3D)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Xian

As what was mentioned. I have this problem in which i am having a hard time finding the node of the object i have collided with after using move_and_slide with my kinematicBody.
So far I was able to get the data of what i collided with using

func _physics_process(delta):
	#Get Collided node
	for i in range(get_slide_count() - 1):
		print(get_slide_collision( i ).get_collider_id())

this got me the unique id of the collided object though i cant seem to be able to find the object with the corresponding id and its node. Please help

:bust_in_silhouette: Reply From: Eric Ellingson

Instead of calling get_collider_id() can you just call get_collider()?

Yup that fixed it thanks eric

Xian | 2019-07-28 11:53