You cannot call move_and_slide
on a RigidBody2D
as it simply isn't a method of that class. Would you explain a little what you want to achieve and why you are not using a KinematicBody2d
if you need move and slide? You could also implement your own move_and_slide
, but perhaps there is an easier solution for your use case.