Override sprites in inherited AnimationSprite node

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

Hello. Is this possible to override sprites in AnimationSprite node? I am trying to make different fighters from one base scene, is it possible to do?
enter image description here

When I do it now all changes are lost after restart or in game.

:bust_in_silhouette: Reply From: MysteryGM

One way would be to make every sprite it’s own scene. Then place them all under a 2D node, using the animation player you toggle manually what sprite is active.

It will look like this:
enter image description here
Here is a zip with the project:
https://drive.google.com/open?id=1kW3rMCksXUM0KCewNPXRRJXkE594WBXa

The nice thing about doing it like that, is that you can use Godot’s “group” system or even just the signal system to check collisions then.

Most fighting games animate the collisions or do cell checks.
What you are doing here, animating collisions like sprites isn’t what collision systems are made for, expect some problems.

The Godot Area2D will be the most stable for what you are doing, since it works like a cell lookup.
Try collisions first and if there is bugs try the Area2D.