Hello!
I am trying to make a bullet curve through raycast, and I have a problem.
https://gyazo.com/3e07f7ea678b4325c38ed2f55ae039cc
if bulletCount > 3 and bulletCount < 10 then
rayCastDirection = hrp.CFrame.LookVector + v3((curveAmount^1.5)/Dampen,0,0)
end
The above code basically increments to the x value of the direction offset, forming a curve.
The problem is I’m not sure how Vec3 directions work, which results in different curves on walls facing different directions.
I’m pretty sure I’m applying the curve thing wrongly, but lmk what it should be and why
2 Likes
Maybe you could use bezier curves? Pretty useful, here’s an article about it: Making barrage arms go in an arc motion?
This will always be in the X direction.
What you want is for it to be relative to the characters x Axis.
hrp.CFrame:VectorToWorldSpace (v3((curveAmount^1.5)/Dampen,0,0))
This will make it relative to the X axis of the characters CFrame.
Try worldspacing it or object spacing it, I believe it’s world space as we want a world space result.
that is not related to my problem sir. Thanks for trying though.
I see! That makes sense! Thanks!
EDIT: it worked!