I have a dummy in the workspace, and I tested shooting a part at the player with a bodyvelocity. The problem is, is that it's not even going in the right direction sometimes towards the player, or sometimes it is, it's just crazy. I replaced the BodyVelocity with a BodyPosition to see if the same thing would happen, and the BodyPosition worked, but I just don't find it appealing.
game.Players.PlayerAdded:Connect(function(player) local dummy = script.Parent local char = game.Workspace:WaitForChild(player.Name) while true do local p = Instance.new("Part") p.Shape = "Ball" p.Anchored = false p.CanCollide = false p.Parent = workspace p.CFrame = dummy.Torso.CFrame local bv = Instance.new("BodyVelocity") bv.Parent = p bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge) bv.P = 500 bv.Velocity = char.Torso.CFrame.p wait(5) end end)
I also tried replacing bv.Velocity = char.Torso.Position, and the same thing happened. Any ideas?
thats not how velocity works, first off, velocity works in world space, so rotation wont do anything to effect it, second, if you set velocity to the position of a part, then the x, y, and z coordinates will be transformed into velocity which does not work, if you want to make it use a position, you should be using BodyPosition, or at least use math to figure out how to get the position
you set the parent of the body velocity to workpsace instead of the dummy's lower torso