Setting a projectile's rotation?
Hi, I'm trying to create a gun that fires cylinder-shaped projectiles. I want the projectiles to be rotated in a way that the ends are facing downwards and not side to side.
01 | player = game.Players.LocalPlayer |
03 | mouse = player:GetMouse() |
05 | local laser = Instance.new( "Part" , workspace) |
06 | laser.Shape = "Cylinder" |
07 | laser.CanCollide = false |
08 | laser.Size = Vector 3. new() |
09 | laser.BottomSurface = "Smooth" |
10 | laser.BackSurface = "Smooth" |
11 | laser.FrontSurface = "Smooth" |
12 | laser.LeftSurface = "Smooth" |
13 | laser.RightSurface = "Smooth" |
14 | laser.TopSurface = "Smooth" |
15 | laser.Rotation = Vector 3. new( 0 , 0 , 90 ) |
16 | laser.CFrame = weapon.Handle.CFrame |
17 | laser.CFrame = CFrame.new(laser.Position,mouse.Hit.p) |
18 | v = Instance.new( "BodyVelocity" , laser) |
19 | v.Velocity = laser.CFrame.lookVector * 90 |
20 | v.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
22 | weapon.Activated:connect(shoot) |
Even though I set the projectile's rotation, the rotation is still way off when it's fired.