How do I get this cannon to fire the way its facing?
01 | c = script.Parent.click |
05 | script.Parent.click.ClickDetector.MouseClick:connect( function () |
06 | if debounce = = true then c.BrickColor = BrickColor.new( "Really red" ) |
08 | pp = script.Parent.Barrel.Position |
09 | b = Instance.new( "Part" , game.Workspace) |
10 | fire = Instance.new( "Fire" , b) |
12 | b.BrickColor = BrickColor.new( "Really black" ) |
14 | b.Size = Vector 3. new( 2 , 2 , 2 ) |
15 | b.Position = Vector 3. new(pp.X, pp.Y , pp.Z) |
19 | b.Touched:connect( function (hit) |
20 | if hit.Parent then if hit.Parent.Name = = barrel then |
24 | e = Instance.new( "Explosion" , b) |
25 | e.Position = b.Position |
34 | c.BrickColor = BrickColor.new( "Bright green" ) |
Ive tried everything. All the body positions, CFrame and I cant get the cannon ball to fire in the direction the cannon is facing. I tried making the cannon ball point in the direction of the cannon but being confined to XYZ I have no idea how to do it. - Thanks