# How do i prevent a Projectile Movement Component to stop when it hits something?

**URL:** <https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387>\
**Category:** World Creation\
**Tags:** projectilemovement, unreal-engine, projectile, question, CPP\
**Created:** [October 27, 2014, 12:57pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387 "2014-10-27T12:57:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [October 27, 2014, 12:57pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/1 "2014-10-27T12:57:04Z")

</div>

Hello, i have a projectile with a Projectile Movement Component, and when it hits a character i want it to continue its movement, but it currently stops, how do i prevent that? I tried setting the character to overlap the projectile and added a OnComponentBeginOverlap but he’s not detecting the character (i put the capsule collider to ignore projectiles and the mesh to overlap it, on the projectile i set it to overlap pawns).

---

<div class="post-metadata">

**Author:** ![TheMunky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheMunky](https://forums.unrealengine.com/u/TheMunky)\
**Post date:** [October 27, 2014, 1:02pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/2 "2014-10-27T13:02:09Z")

</div>

I can’t be too sure but try it so when the projectile overlaps with something, it’s projectile velocity drops to 0 ?

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [October 27, 2014, 1:10pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/3 "2014-10-27T13:10:30Z")

</div>

Right now with the overlap approach he’s not triggering the callback for overlaps. But i want the projectile to keep going and only stop when he hits a wall or the floor.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9308b33e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9308b33e](https://forums.unrealengine.com/u/anonymous_user_9308b33e)\
**Post date:** [November 2, 2014, 10:50am UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/4 "2014-11-02T10:50:18Z")

</div>

Looking for the answer to this as well. I have a spherical shield and my player fires from within the shield. When a hit is detected (as soon as the projectile spawns) the projectile stops. My understanding based on another related question is that as soon as a hit is detected the ProjectileMovement is detached. I tried using an OnProjectileStop delegate but am having no luck with this. Seems like there should be an easy solution. Hop someone knows.

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [November 3, 2014, 7:28pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/5 "2014-11-03T19:28:41Z")

</div>

In your case you can set the projectile to ignore the shield object type in the collision options.

---

<div class="post-metadata">

**Author:** ![Rasponien](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rasponien](https://forums.unrealengine.com/u/Rasponien)\
**Post date:** [December 14, 2017, 7:30pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/6 "2017-12-14T19:30:03Z")

</div>

Having exactly same problem. I don’t know how to make my projectile keep moving after it hits anything. When setting velocity for the bullet right after the hit event for the projectile movement component, it seems to have that velocity, but apparently nothing happens.

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 14, 2017, 7:33pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/7 "2017-12-14T19:33:58Z")

</div>

I did this a while back and i think it works:

```
ProjectileMovement->OnProjectileStop.AddDynamic(this, &AProjectile::OnStop);

void AProjectile::OnStop(const FHitResult& Hit)
{
    ProjectileMovement->SetUpdatedComponent(CollisionComp);
    ProjectileMovement->Velocity = FVector(1000.0f, 0.0f, 0.0f);
    ProjectileMovement->UpdateComponentVelocity();
}
```

---

<div class="post-metadata">

**Author:** ![Rasponien](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rasponien](https://forums.unrealengine.com/u/Rasponien)\
**Post date:** [December 14, 2017, 8:37pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/8 "2017-12-14T20:37:43Z")

</div>

Thanks alot for pointing out the solution for me. After reading various posts about the same problem I started examining UProjectileMovementComponent class and I realized there’s a function HandleImpact that gets executed when hit event is registered. Unless the bullet is set to bounce, StopSimulating function will get executed, which does the following:

```
void UProjectileMovementComponent::StopSimulating(const FHitResult& HitResult)
{
	SetUpdatedComponent(NULL);
	Velocity = FVector::ZeroVector;
	OnProjectileStop.Broadcast(HitResult);
}

```

I had idea to create subcomponent based on projectilecomponent, override this function and do nothing in that function. But your solution is really great aswell.

Thank you,   
  
With regards.

---

<div class="post-metadata">

**Author:** ![Rasponien](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rasponien](https://forums.unrealengine.com/u/Rasponien)\
**Post date:** [December 15, 2017, 12:13am UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/9 "2017-12-15T00:13:59Z")

</div>

Hello!

I lurked around in the documentation of UProjectileMovementComponent and I think I found more effective way to make the bullet unstoppable.   
  
  
**SOLUTION**

1. Create UProjectileMovementComponent inheriting movement component class

2. Add lines to your created component class to override next functions:

3. Implement HandleBlockingHit function as seen below:

4. Leave HandleImpact function empty

**EXPLANATION**  
  
  
Projectile movement component is running TickComponent method to update the motion of the updated component. Each time our updated component hits something, HandleBlockingHit function is executed, which will then return EHandleBlockingHitResult enum type value to decide what to do next with the updated component. The enum value comes basically from HandleImpact function, which by default checks whether the bullet is bouncing or not.

1. if bullet is not bouncing StopSimulating function will be executed and the updated component will be set to null, HandleBlockingHit will return EHandleBlockingHitResult::Abort value
2. If bullet is bouncing, HandleBlockingHit will return EHandleBlockingHitResult::Deflect value and will start counting bounces
3. there is also a third enum value EHandleBlockingHitResult::AdvanceNextSubstep in this enum, specially designed for that case scenario (I assume) as based on the value, hit events are ignored in TIckComponent function.  
  

So when the bullet is meant to move after hit events you would want to return EHandleBlockingHitResult::AdvanceNextSubstep in HandleBlockingHit function. A remark why to leave HandleImpact function empty - you wouldn’t need to use any logic there because the bullet is not bouncing and otherwise it will stop simulating component velocity.   
  
  
  
If you have any further questions or you didn’t understand some part of it, feel free to ask.   
  
With regards!

---

<div class="post-metadata">

**Author:** ![SRiddle123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRiddle123](https://forums.unrealengine.com/u/SRiddle123)\
**Post date:** [January 8, 2024, 6:14pm UTC](https://forums.unrealengine.com/t/how-do-i-prevent-a-projectile-movement-component-to-stop-when-it-hits-something/297387/10 "2024-01-08T18:14:13Z")

</div>

Hi , I want to ask a question. if I set the state AdvanceNextSubstep, the hit will ignore. But I don’t see code to reset the EHandleBlockingHitResult, So why the second hit will be check?/(ㄒoㄒ)/~~  
Thanks
