Godot Version
4.3.stable
Question
`I have skins_screen.tscn and skins_screen.gd files seen in image 1. I have also player.tscn and player.gd seen in image 2. I have instantiated child scene of player.tscn in world.tscn.
Image 1
Image 2
I would like use skins_screen.tscn scene’s File Dialog to choose image file to be used as a player character skin (SpriteFrames). Image file has several frames in it 32x32 pixels each.
Right now I have hard coded animation update so when file is chosen it changes Global.default_skin value to 0. When pressing reset button it is changed back to 1. Either idle animation and its SpriteFrames are used or idle_2 animation and its Spriteframes are used and so on. That’s how func update_animations works right now.
The problem is that I would like use a script to delete SpriteFrames from idle_2 and add new SpriteFrames from chosen image file.
→ is it possible to run a function that is in another gd file to change SpriteFrames that are in another scene? Choose image file in skins_screen.gd and skins_screen.tscn and use function in player.gd to delete and add Sprite Frames of AnimatedSprite2D in player.tscn.
I have read about Atlas Texture but I’m not sure about it.
`