Invalid call. Nonexistent function 'is_colliding' in base 'CollisionShape2D'

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

So, i have this problem. I’m trying to make a StaticBody2D to detect a collision, and when it does so i want to play an animation, that’s it. But it gives me this error (Invalid call. Nonexistent function ‘is_colliding’ in base ‘CollisionShape2D’)
Please help!!!

My code is the following :
extends StaticBody2D

func _physics_process(delta):
if $CollisionShape2D.is_colliding():
$AnimationPlayer.play(“Shit”)
else:
$AnimationPlayer.play(“Walk”)

:bust_in_silhouette: Reply From: ramazan

$CollisionShape2D.is_colliding():
It has no such feature.

use StaticBody2D = for wall or floor or etc…

please see this
https://godottutorials.pro/how-to-make-games-godot/