Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | brazmogu |
So, here’s what I’m trying to do: I’m using a particle emitter with the one_shot
flag enabled to show an actor attacking, i.e., shooting a partincle in the direction of a target. Then the actor reloads (i.e., waits a number of seconds) and to shoot again it should activate the emitter again.
This is the code that shoots once:
if not attackOrigin.emitting:
attackOrigin.restart()
attackOrigin.emitting = true
As I said, it works once. Then when the loop runs again it not only fails to emit the particle, but it also crashes without an error. The debugger is showing me this:
I’m using Godot 3.1.1 on a Mac, and I am also sure that the time when I fire the emitter again is larger than the lifetime of the particles. Is there a better way to do this than creating an emitter tha destroys itself after it’s done, or just setting my emission frequency to the frequency of shots I want (which would not only make it impossible to have a variable rate, but also it’d make it impossible to have more than one shot at once)?
hi, you name a node which is not English charachters?
Okan Ozdemir | 2020-05-03 18:32
No, all my nodes are named with nothing but letters, numbers and spaces.
brazmogu | 2020-05-03 20:35