Hi guys!
I have a little bug right here and i don't know how to fix it. Im implementing a dash in my game, i follow tutorial Celeste dash like. The problem i have is that, im using Sprite and AnimationPlayer. And the video is using AnimatedSprite.
basically he just create a scene with a Sprite with a simple script.
extends Sprite
func _physics_process(_delta):
modulate.a = lerp(modulate.a,0,0.1)
if modulate.a < 0.01:
queue_free()
Then he use a packed export in the character.
export (PackedScene) var dash_object
After that, some dash logic and then, In the handle_dash() function, because he has an AnimatedSprite, he use:
if is_dashing:
var dash_node = dash_object.instance()
dash_node.texture = ani.frames.get_frame(ani.animation,ani.frame)
But i use, because of the sprite:
if is_dashing:
var dash_node = dash_object.instance()
dash_node.set_texture(sprite.texture)
In my sprite.texture i have 7 frames, but i couldn't make to show just one frame, it show all of them. Example
Should i use AnimatedSprite? Is it to posible to fix it with just the sprite?Should i use something else?. I use the documentation, but i couldn't make it work.