So I'm making this attack where three rocks are fired at where the mouse is pointing when you click. Everything fires well but the rocks seem to miss its target drastically.
This is what it looks like: Rock Shooting
These are the lines of code that I'm using to make the rocks fire, theres more before it but I think this is where the problem is:
enabled2 = true speed = 50 Carbons = {CarbonH, CarbonH2, CarbonH3,} welds = {weld1, weld2, weld3,} local clearing = 1 Mouse.Button1Down:connect(function(key) if not enabled2 then return end enabled2 = false welds[clearing]:Destroy() local Woosh = Instance.new("BodyVelocity") Woosh.maxForce = Vector3.new(math.huge, math.huge, math.huge) Woosh.velocity = CFrame.new(Player.Character.Torso.CFrame.p, Mouse.Hit.p).lookVector * speed Woosh.Parent = Carbons[clearing] Carbons[clearing].Parent = workspace clearing = clearing + 1 wait(1) enabled2 = true if clearing == 4 then enabled2 = false wait(5) enabled = true end end) end end)
I think lines 14-18 is where the problem is but I can't figure out whats wrong.
If you need the whole script please tell me and thank you.
Alright, so your problem might be in lines 14-18 and I think I know what it is sorry it's hard to tell because I can't just copy and paste your script into my studio and test it because apparently you got some other part in the script that isn't here because it keeps erroring the ends and the tables... so anyways..... For the BodyVelocity
.... You should do something like this
Woosh.velocity = CFrame.new(Player.Character.Torso.Position, Mouse.hit.p)
I hope this helped!