Shotgun spead correction

I am trying to create a shotgun spead, i have the spread working however it is shooting upward and i cannot figure out how to correct it. Any ideas? Also the non shotgun rounds fire correctly.




I think you’re meant to pass a vector into that cone function, and then multiply the result by the length you want.

You’re passing in a location and then chopping up the result :slight_smile:

Get the forward vector from the muzzle.

So to do random line traces in a cone from the first person weapon, I used

1 Like

The input going into the cone is a vector. thanks for the info i will see what i can come up with after work

Yes, it’s a vector variable, but it’s actually the location of the muzzle, not its direction.

1 Like

Ah i see what you mean, so i could probably take the rotation and get the forward vector → into the cone?

1 Like

You can probably do pretty much what I did :slight_smile:

1 Like

The issue is that i need a starting location and direction for my projectile system, starting location is easy but how would i get the direction with the way you did it? The projectile system gets the end point based on the ammo so i dont need an end point but the direction is required. I appreciate you taking the time to reply :slight_smile:

1 Like

We’re talking about the initial direction vector here, and that’s coming from the muzzle, no?

1 Like

Thank you very much, this is what i had wrong. wouldnt have figured it out without your help… basically i needed the ‘get rotation X Vector’

1 Like

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