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.
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.
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.
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.
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.
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.
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.
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.