Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a projectile always go in the forward direction that the character is facing?

Asked by
steelflix -12
4 years ago
BodyVelocity.Velocity = player.Character.HumanoidRootPart.CFrame.lookVector * 75

I've been using this line of code to make a projectile face in the forward direction that the character is facing, but it does not always work, especially with a fly script where your character can face in whatever direction your mouse is pointed to. How would I make it so that the projectile always goes in the forward direction that the character is looking at?

1 answer

Log in to vote
0
Answered by
Launderer 343 Moderation Voter
4 years ago

Using the HumanoidRootPart's lookVector is actually the correct way of doing this. However the HumanoidRootPart isn't rotated in any sort of direction during animation's which I'm assuming is the issue to your problem. So Instead of using the HumanoidRootPart use either Head, Torso, LowerTorso, or UpperTorso (Which ever of these fits your needs)

Ad

Answer this question