I'm trying to make a projectile use the aimed direction to shoot a projectile. I tried doing this
potato.CFrame = CFrame.new(potato.CFrame.Position,plr.Character:FindFirstChild("HumanoidRootPart").CFrame.lookVector) potato.Velocity = Vector3.new(-exitforce,0,0)
but it does not work. How would I do this? The idea of the script excerpt was to make the look Vector point forward and use the X-axis to shoot it forward.
Basically: How do I shoot a projectile at a certain speed at a certain direction (direction is dictated by the CFrame.Angles() of the character and speed is by a variable)
You can use BodyGyro to change direction, and BodyVelocity separately to do this. Funny thing is I just started with a plane that measures forward velocity relative to the part's cframe. Anyway, I set my bodygyro cframe by:
BodyGyroName.CFrame = CFrame.new(Vector3.New(), --[[ LookAt position]]
and you could do
BodyVelocityName.Velocity= Vector3.New(Part.CFrame.LookVector.X*-exitforce,Part.CFrame.LookVector.Y*-exitforce,Part.CFrame.LookVector.Z*-exitforce)
for the speed.