Hey, so how would I make a cannon ball shoot out, then gradually fall to the ground?
If you need an example, here is one:
Is this automatic when using body velocity or something? Or would I need to script it?
Hey, so how would I make a cannon ball shoot out, then gradually fall to the ground?
If you need an example, here is one:
Is this automatic when using body velocity or something? Or would I need to script it?
Maybe this can help:
local bodyVelocity = --get your bodyvelocity
local speed = 30
local Distance = (somePart.CFrame.LookVector * 30 - somePart.Position).Magnitude
bodyVelocity.Velocity = (somePart.CFrame.LookVector * speed)
wait(Distance/speed)
bodyVelocity:Destroy()
As @XXgamerisaliveXx said, getting an instant velocity established, will shoot the ball using physics. You need to make sure your max force is high (so it reaches that speed immediately) and that you Destroy() the velocity so it doesn’t maintain the direction.
After that the physics engine will finish the rest with gravity. I’ve used it for bouncing balls around in a game.
If, however, you need control of the ball, you can do some math.