Projectile Movement : Stop / Start

Hi all,

I’m trying to “halt” actors in my game when certain events happen (without using pausing the game).

I have everything sorted apart from projectiles. I can make them stop moving, but I don’t seem to be able to make them move again after they’ve been stopped and I’m not entirely sure why.

My projectiles use the ProjectileMovement component.

To “halt” them, I was setting their Velocity to zero (from either -1.0 / 1.0 depend whether they were going up/down the screen). When I want them to resume, I then set the Velocity back to the respective value (-1.0 / 1.0) but they do not move.

I looked online and found someone using SetVelocityInLocalSpace, so I gave that a go, not entirely sure what the difference is, but the outcome was the same. I can make them stop, but not go again.

I’ve output the velocity after its been reset, and the initial speed and maximum speed and they are all set as I would expect.

Can anyone indicate to me what I’ve missed?

Thanks in advance :slight_smile:

So it turns out that where I had the Velocity set to -1.0 / 1.0 - the component must then multiply this value by the initial/maximum speed values when its initiated. I was subsequently setting the value back to -1.0 / 1.0 - so 1000 times slower than its original speed.

I had to fire off another projectile and compare the differences to spot this.

Instead of setting the velocity, can you try enabling / disabling the Tick of the component. Not the actor’s but the actual component’s.

Set Component Tick Enabled is the name of the node.

Thanks for the reply and the heads-up, I’ll give that a go too, as it will help to declutter a little bit. Thanks! :slight_smile:

If I remember correctly in some cases (depending on the setup - something to do with initial speed) Velocity is not velocity at all but a direction vector - so that’s nice and misleading.

Tick should work here, though.

For anyone who runs into this, component tick enable/disable didn’t work for me (at least UE 4.27.2), but disabling projectile movement component auto-activate then activating/deactivating later did the trick.

You are awesome. this did the trick !