Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.