# How to make Projectile bounce sometimes but not all the time

**URL:** <https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203>\
**Category:** World Creation\
**Tags:** bounce, unreal-engine, fps, Physics, projectile, Blueprint, question\
**Created:** [March 13, 2021, 3:14am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203 "2021-03-13T03:14:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 3:14am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/1 "2021-03-13T03:14:09Z")

</div>

I was wondering if someone can point me in the right direction.

Currently my projectile bounces everytime it hits a wall or object before being destroyed by Inital Life Span. I wanna make it to where if I shoot 5 times at a wall, it may or may not bounce once out of the five shots and the other 4 shots get destroyed. Randomly of course.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [March 13, 2021, 3:16am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/2 "2021-03-13T03:16:05Z")

</div>

Create two projectile classes. One that bounces and one that doesn’t. Randomly choose which to spawn per shot.

Or On spawn randomly disable bouncing.

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 4:21am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/3 "2021-03-13T04:21:22Z")

</div>

Something like this?

 ![332300-shouldbounce.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/8/5188231ede60f8f577371b93fbc3649675e2a8dc.png)

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 4:33am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/4 "2021-03-13T04:33:59Z")

</div>

The one above some what worked, it bounced more often than not which is the opposite of what I was wanting. I thought this new one made more sense but it no longer works. I’m gonna take a break and come back to it.

Any thoughts?

 ![332321-shouldbounce2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/a/dfaa789a3f6b4e427a07fd6f63f0bccf5a99302b.png)

---

<div class="post-metadata">

**Author:** ![Cross669](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cross669](https://forums.unrealengine.com/u/Cross669)\
**Post date:** [March 13, 2021, 4:47am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/5 "2021-03-13T04:47:05Z")

</div>

The bool is set properly on the projectile movement, maybe just add a branch with destroy actor after your add impulse node, or a small (0.1 Sec) delay then destroy actor after setting should bounce to let your add impulse take effect.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [March 13, 2021, 7:19am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/6 "2021-03-13T07:19:47Z")

</div>

It’s a lot easier if you use Projectile Movement Component. It has a bounce toggle.

> **[Projectile Movement](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Game/Components/ProjectileMovement/)**
>
> Projectile Movement

Branch (If rand(1-5) == 1) { enable bounce}

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 13, 2021, 10:17am UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/7 "2021-03-13T10:17:14Z")

</div>

mhm, bool with weight:

![332331-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/a/6caa62331e39beb7827cd104d83cb79a0af37434.jpeg)

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 7:10pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/8 "2021-03-13T19:10:08Z")

</div>

That was pretty much what I was trying to do but didnt know what nodes to use.

 ![332362-porjectilebounce3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/3/cf360e617bba9f34d9b07d12db726a374bea8a73.png)

So it works if I plug it directly into the Event hit, but why wont it work plugged up like this? Is it the ‘Is Simulating Physics’ thats causing it to not work? I’m unsure.

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 7:14pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/9 "2021-03-13T19:14:40Z")

</div>

Update, as I was looking at the screen shot and folloing the blueprint spaghetti I figured it out.

I forgot that the ‘Is simulating physics’ is for the other object the projectile hits. If I add the ShouldBounce before that branch it works like it should. Thank you guys very much.

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 7:19pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/10 "2021-03-13T19:19:33Z")

</div>

Working Blueprint

 ![332364-bounce5.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/b/7fbb75cfd0c5648af970c6841e13183e83fa3e1a.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 13, 2021, 8:04pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/11 "2021-03-13T20:04:14Z")

</div>

I’ll just add this is better (feels cleaner) handled in the Constructions Script of the projectile:

![332358-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/1/f116a449506f25e80303af8bd2a28e3e9fd84b9b.jpeg)

But if it works fine as is, you’re good.

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 8:11pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/12 "2021-03-13T20:11:27Z")

</div>

Is there a way to still run it off Event hit? While this cleaner (I perfer it this way as well) I lose the event hit that adds random bounces. Sometimes itll bounce once, twice, or three times before intial life span ends it.

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 8:12pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/13 "2021-03-13T20:12:11Z")

</div>

I could turn it into a fucntion duh

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 13, 2021, 8:22pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/14 "2021-03-13T20:22:07Z")

</div>

Makes sense. You will want to adjust it to your needs.

* * *

One note here, since you mentioned simulating physics on a projectiles movement component. You can’t have both at the same time:

```
Normally the root component of the owning actor is moved, however another component may be selected (see SetUpdatedComponent()). If the updated component is simulating physics, only the initial launch parameters (when initial velocity is non-zero)will affect the projectile, and the physics sim will take over from there.

```

* * *

In short, in most cases, you _do not_ want to simulate physics on the Projectile Movement Component separately. The component itself does the heavy lifting here.

So if you ever run into any inconsistent behaviours - that could be the culprit.

Good luck with the rest.

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 8:22pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/15 "2021-03-13T20:22:11Z")

</div>

This way, if bounce is set to false it destroys the actor on impact while still running the rest of the blueprint to add impulse.

 ![332366-bounce10.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/2/f92b21da7401130b064488cc69551f778da11646.png)

 ![332367-bounce11.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/4/3a4f2488aed252a56e591e0e3f04166fdc8930ce.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 13, 2021, 8:27pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/16 "2021-03-13T20:27:03Z")

</div>

I’d set it in the Construction Script and decide what to do when it hits:

![332359-screenshot-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/8/738aa673cdbabb51fc5444e28b34bd0120c350f0.jpeg)

_Should_ work. Fingers crossed!

---

<div class="post-metadata">

**Author:** ![B3P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B3P](https://forums.unrealengine.com/u/B3P)\
**Post date:** [March 13, 2021, 8:28pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/17 "2021-03-13T20:28:40Z")

</div>

Did not know that.

But when I say simulating physics its not the projectile that has the physics but the object it hits (If physics are enabled) So If I shoot an object that has physics enabled, it will move.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 13, 2021, 10:39pm UTC](https://forums.unrealengine.com/t/how-to-make-projectile-bounce-sometimes-but-not-all-the-time/480203/18 "2021-03-13T22:39:40Z")

</div>

Ah, that makes sense.
