0 votes

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:

image :100">

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)?

in Engine by (72 points)

hi, you name a node which is not English charachters?

No, all my nodes are named with nothing but letters, numbers and spaces.

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.