I'm currently working on scripting a cannon. Now i want to make a cannonball shoot out of the cannon when pressing F. To register the player presses 'F' I'm using ContextActionService and this event fires the server. This works so far.
I used this script to make the cannon shoot:
local canFire = true FireCannon.OnServerEvent:Connect(function() if canFire then canFire = false wait(.25) local newBall = CannonBall:Clone() newBall.CFrame = CannonBarrel.CFrame newBall.Velocity = CannonBarrel.CFrame.lookVector * 50 -- Speed 50 newBall.Parent = workspace newBall.Anchored = false wait(1) canFire = true end end)
However the cannonball is falling out of the side. How can make the cannonball flying out where it should fly out?