why is the "is_colliding()" function delaying to detect collision?

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

I am trying to make a character that will stop and change direction when it reaches the edge using a raycast2d. However, the raycast2d is delaying by 8seconds before it can detect collision. What can be the cause of this?

:bust_in_silhouette: Reply From: Wakatta

Most likely because of the way your code is structured as it depends on how and where is_colliding() is being called

Like for example if you’re using it in _physics_process(delta): and need immediate access use force_raycast_update() before calling is_colliding()