0 votes

I want to put a animation for the fire ball when it touch any body, a animation of the fire dying but i don't know how do this

This is the script of the fire ball:

OBS: The animation called "Off" is the dying fire animation

extends Area2D

const SPEED = 180
var velocity = Vector2()
var direction = 1

func _ready():

func setfireballdirection(dir):
direction = dir
if dir == -1:
$firesprite.fliph = true

func process(delta):
velocity.x = SPEED * delta * direction

func onnotifierscreenexited():

func onFirebodyentered(body):

func onfirespriteanimationfinished():

in Engine by (21 points)

2 Answers

+1 vote
Best answer

The "Fire" animation is in process so "Off" only gets to play for a single frame. $fire_sprite.play("Fire") either needs to go in ready or a condition that will happen for a single frame e.g.

func process(delta):
    if myBool == true:
        myBool = false
        #won't happen again until myBool is set to true.
by (3,247 points)
selected by

Thanks bro!!

0 votes

I done it for tds right 2 days ago.
But i use the boom animation
for fireball dying.
If you mean, you don't know how to draw it you
can find it in the web or email me for my sprites or
We can talk about making new sprites for you

by (13 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.