#Raycast 3D not activating kill function
44 messages · Page 1 of 1 (latest)
is there an if statement line of code somewhere in your enemy script that triggers if dead== true?
no, that should work.
what exactly do you want to happen once the enemy dies? and what actually happens when you run it right now?
play the death animation, remove collision
right now it just keeps running in place
oh yeah and play the death sound
okay, im assuming "pwned" is your death animation and that it doesnt loop?
okay, try adding an await animated_sprite_3d.animation_finished() before writing the dead = true at the very end of the kill function
what happens in run with these changes?
nothing changes at all its still just idling
i dont think the kill function is activating at all cause not even the sound is playing
hmm, to test, write a print("TEST") at the very top of the kill function then try
just to see if the function is actually getting called
would test come up on screen if its working? cause nothing showed up
"TEST" should show up in the output in the godot editor
Nope, nothing :(
try replacing the last line of code here with ray_cast_3d.get_collider().call("kill")
STILL not working
but does it print the "TEST" now?
No it doesnt
I downloaded the tutorials scripts and copied them in exactly and it still doesnt work
the enemy doesnt even mov
move*
so i think its something thats wrong with how i made the enemy
what version of godot was the tutorial for? though unlikely, maybe there's a mismatch
4.1, but i figured it out but not really
I just remade the enemy from scratch and it worked fine
i still have no idea what i did wrong
oh? lol what was different
thanks for the help though i appreciate it
no idea! it just worked this time
i probably hit something stupid by accident
i tried, glad it's fixed now, though
happens to the best of us, dw
day 2 of learning to make a game i suffer for two hours on how to make a png make a noise
oh me too believe me