On / off button

Hello, I would like to use a key to activate a continuous movement which only stops if I press this same key again, is this possible?

There’s many way to approach it, though - depending on what’s really needed in the long run.

Hi :slight_smile: - like this:

I already use the event tick for a camera, is there another way?

I didn’t understand how to do this, I have to do 2 new functions?

Ah, you didn’t say tick… then like this:

Oh thank you very much, I searched for a little while how to split a signal. So I have a question, does that cause a lot of delay and overload the game? Or can I put several “sequence” blocks in a row? I started UE4 not very long ago, I am still inexperienced. And I’m French, sorry for my possible mistakes.

Notice the sequence node has an ‘add pin’ button, you can add as many pins as you like.

Do be aware though, that tick is the main place that newibes bring the engine to it’s knees. It really depends what you hang on there.

I can be a lot of nodes, and have almost no impact, or, if you’re not careful, with just a few nodes you can totally wreck your performance.

I just hunted out some code where I know I have a lot on tick:


but it has no impact.

Whereas if you do something like this:

would defintely NOT be good… :slight_smile:

Ok thank you for your tips.

I don’t understand something, what do the blue blocks correspond to? Is it a function?

I’m just calling a custom event that I called something like ‘your stuff’. It’s just so you can imagine that the rest of your code goes there…

I understood that, I wanted to know if it was a technique to lighten the blueprint by attributing a series of actions to a single block. and I don’t understand how to stop the movement.

It makes no difference to the performance, it’s just a tidy thing :slight_smile:

I thought you already had the movement code?

Yes I have no problem on that side. I did some tests and suddenly I saw that I don’t need to put something for “stop movement”. Anyway, thank you for helping me again.