How do I add or remove a frame from an AnimatedSprite2D

Godot Version

4.4.1

Question

How do I add or remove a frame from an AnimatedSprite2D in gdscript? is there a function to add a frame using a texture? If someone could explain how I could add a texture via code and not have to add in the image because there is more than one image I have to add and it’s all random items for an inventory system.

You can add a frame to the AnimatedSprite2D.sprite_frames Resource with SpriteFrames.add_frame() and remove a frame by index with SpriteFrames.remove_frame()

Que voulez vous faire exactement

That doesn’t work do you think you could send over a body of code I can use?

Never mind I figured it out.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.