The title basically explains the problem im making a auto canon for an aircraft and it kinda works but for some reason the gun keep shooting i different directions each time I play
- Heres a video of two different Runs.
https://streamable.com/epzxkd
https://streamable.com/mh8wk2
Here the code for it
local gunpart = PlaneFolder.Plane.Weapons.MachineGun
local Bullet = rp:WaitForChild("Bullet"):Clone()
Bullet.Anchored = false
Bullet.Size = Vector3.new(.4, .4, .8)
Bullet.BrickColor = BrickColor.new("Olivine")
Bullet.Material = Enum.Material.Neon
Bullet.Name = "Bullet"
Bullet.CanCollide = false
Bullet.CanTouch = true
Bullet.Transparency = 0
Bullet.CFrame = gunpart.CFrame
Bullet.Parent = game.Workspace
local bv = Instance.new("BodyVelocity", Bullet)
bv.MaxForce = Vector3.new(5000,5000,5000)
bv.Velocity = (gunpart.CFrame.LookVector.Unit * 600)
bv.P = 100
local floatingForce = Instance.new('BodyForce', Bullet)
floatingForce.force = Vector3.new(0, 196.2 * Bullet:GetMass() * 0.98, 0)
Debris:AddItem(Bullet, 7)
Any Help is Very Appeciated