Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | heavyathan |
Hi guys.
I’m facing a issue that is frutating me as I cannot find the trick.
I’m trying to create an explosion effect when a magic bolt impacts something. The approaching is similar to the TPS Demo Shooter, but I use a Area node as root.
The bolt is done following this YT tuto:
My problem is that in the very moment one bolt impacts something, all next bolts are instanced in last status of animation, or this seems. I’ve tried to stop animation before queue_free(), set all parameters as they should be in _ready() but nothing seems to work.
I’m quite sure is a stupid detail but honestly, I’m quite blocked.
My ball scene:
https://ibb.co/VvXLHPW
A link to an small video:
https://drive.google.com/file/d/1Y8PCA9a5KSTw89zE4PnhODZGzqDLO8_h/view?usp=sharing
Involved code:
func _on_bola_body_entered(body):
if ball_ha_dado == false:
if body.has_method("dolor"):
#paso el daño, la posicion de la colision
body.dolor(DAMAGE, global_transform)
col.disabled =true
bolt_anim.play("explotar")
ball_ha_dado = true
Thank you.
is the code indented properly? ball_ha_dado = true
seems to be outside the last if check
vnmk8 | 2021-07-07 01:58
Hi, Vnmk8.
It’s outside, but on purpose. The if stament is just to ensure behind enemies are not being affected due to time gaps until queue_free().
heavyathan | 2021-07-07 06:08