Line Traced random spread

I have a basic linetrace gun that looks like this.
I want to plug in some kind of function to randomly offset the “bullet” angle by a variable.
So if I simmulate say a claymore mine I get 700 lines with a 60 degrees spread in width and 20 degrees spread in heigth.

Or if I make a grenade, I will have a spread in a sphere

The ‘multi’ on this node, just refers to the fact that it will go through more than one mesh, and return everything it finds.

If you want to do a weapon spread cone trace, you need to do the math to get spread :slight_smile: and you can just use a normal single line trace node.

So you need two loops, one for the up and down, and one for the left and right, and you set the angles and amount of traces for each weapon.

1 Like

a couple of handy functions too help are

RotateVectorAroundAxis
RandomUnitVectorInCone

3 Likes

This might be useful :slight_smile:

Oh, yes I know that. The multi node is for other purposes.
I was thinking of some combination of nodes to plug in on the -end side.
I have For-loop to set the number of shots/fragments.

Hey, Super thanks! It worked like a charm.

A reference image:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.