How to make a part's position move randomly but align with the HumanoidRootPart?

Hi DevForum,

I came across a question while scripting. I was trying to make a barrage test, and noticed how a part was always keeping the same Position it has, and wondered how i would make the barrage have that “spread” by moving the part’s position left or right from the LookVector of the HumanoidRootPart.

For Example,

What I have right now:
image

What I want to achieve:
image

Meaning, the position randomizes based where the HumanoidRootPart is facing. I already have the part set where the orientation of the part is aligned with the HRP.

2 Likes

You already have the axis of the RightVector and UpVector of the humanoid root part as well.

Just add on to that to the current position with a random number

+Part.RightVector*randomNumber

2 Likes