Script inherits from native type 'AnimatedSprite', so it can't be instanced in object of type: 'Node2D'

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

i am makeing my first game in godot and i am trying to animate a sprite in godot and i get this error Script inherits from native type ‘AnimatedSprite’, so it can’t be instanced in object of type: ‘Node2D’

:bust_in_silhouette: Reply From: kidscancode

You have written a script that begins with extends AnimatedSprite but you attached that script to a Node2D. That is what the error message means.

My understanding of this and how I fixed it was, I Created an animated sprite then added a script and made sure it inherits at the AnimiatedSprite2D and continued with the play and other functions

betrayedMasa | 2023-04-21 04:55