How can I control these projectile aspects

Hello,

Still new to UE blueprint tricks but learning so I appreciate your feedback:

To create a shotgun spread, I decided to go simple. So I created a disk projectile with collision settings.

It is working as intended but now to simulate the spread (disk) getting wider through distance while impact becoming smaller, I could not figure out how to do that in this shoot event blueprint below

I think I need to increase scale to a max size (Variable) and reduce the impact (variable) but could not find the right nodes

Also, I am not getting the disk to hit 2 close targets at once. When it hit one, it does not affect the other nearby. I tried a few combination of collisions but did not succeed

Thanks!

Hey Claviateur!
What you need is a cone trace which there is a whole different thread for that: Cone Trace - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com).

However, I recommend multiple line tracing. You can cast multiple random lines in random directions with a maximum deviation angle from your gun forward vector, imitating a cone. If you are having trouble with random line directions, you can pick your direction as simply as done in this:
image
Which is a cone that is seen as a circle from the perspective of your gun with the lines as the deviation of your line directions from the forward vector. You can also change the number of lines as your project requirements desire.
Now you don’t have to reduce the impulse as the hit distance increases since each line trace could add its constant impulse and the closer the object is, the more lines hit it and the more impulse it catches. Also, now you can hit multiple objects with one shot. If you are trying to be very realistic, yes, you can also take the hit distance of each line into the calculation of the impulse it is adding.

If had any issues with making the blueprint, just post here and I’ll be happy to help!

1 Like

Thanks for the recommendation but I was avoiding line trace because I am a beginner in Blueprints. Do you recommend any tutorial for this please?

Oh, I see you added a link, thanks! I believe this one is for another method than line tracing. I need to evaluate each for performance as well

Check this out: Using a Single Line Trace (Raycast) by Channel in Unreal Engine | Unreal Engine 5.3 Documentation.

It is an Unreal Engine tutorial for line tracing. There are tutorials for other tracing methods too.

1 Like

Thank you so much :slight_smile: