Is there any difference in between these 2 lines at line 9? both of them makes the bullet travel at 200 in the direction i am clicking.
bodyvelocity.Velocity = CFrame.new(part.Position,mouse.Hit.Position).lookVector * 200 bodyvelocity.Velocity = mouse.Hit.lookVector * 200
*part position is the position of the bullet.
full script:
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.Button1Down:Connect(function() print(CFrame.new(mouse.Hit.Position).lookVector *200) local part = Instance.new("Part", workspace) local bodyvelocity = Instance.new("BodyVelocity", part) bodyvelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) bodyvelocity.Velocity = mouse.Hit.lookVector * 200 -- this line part.CanCollide= false part.Position = plr.Character.Head.Position end)
No. That not same.
If you use this
bodyvelocity.Velocity = mouse.Hit.lookVector * 200
The CFrame will be located at player's character.
if you use this
bodyvelocity.Velocity = CFrame.new(part.Position,mouse.Hit.Position).lookVector * 200
The CFrame will be located at the part.