#enemy dissappears but collision is still there

22 messages · Page 1 of 1 (latest)

potent pendant
#

when my enemy dies he queue frees but his collision shape is still there. SOS

olive pond
#

could we see your enemy script ?

potent pendant
#

yeah this is death function
`
func _death():
if main.cop_health <0:
main.cop_health = 0
timer.stop()
chase = false
shoot = false
#utils.saveGame()
get_node("AnimationPlayer").play("death")
await get_node("AnimatedSprite2D").animation_finished
await get_tree().create_timer(0.5).timeout
print("cop deaath")
queue_free()

`

olive pond
#

no, i mean the whole script.

#

but you can do that later (or not if you dont want to) since you said you're gonna go to class now.

true mantle
potent pendant
#

its supposed to, but it doesn't

true mantle
potent pendant
#

okay

#

okay i solved it by getting rid of the animation finished thing and just setting a timer for how long the animation is

potent pendant
vague smelt
potent pendant
strange mist
potent pendant
#

you can do that?

olive pond
potent pendant
#

i thought about using tweens but theyre really confusing to me so i decided to just use the player

olive pond
#

ah, i see

#

then what ayjase said, then

olive pond
#

then click on the "add track" img1, then the "call method track" img2, and then select the node with the script on the popup that will show up. this will add a new track img3. right click to when you want it, then insert key img4 then a popup will appear where you can look for the function you want to call