Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Setting a projectile's rotation?

Asked by 8 years ago

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.

01player = game.Players.LocalPlayer
02weapon = script.Parent
03mouse = player:GetMouse()
04function shoot()
05    local laser = Instance.new("Part", workspace)
06    laser.Shape = "Cylinder"
07    laser.CanCollide = false
08    laser.Size = Vector3.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 = Vector3.new( 0, 0, 90)
View all 22 lines...

Even though I set the projectile's rotation, the rotation is still way off when it's fired.

0
CFrame is Position and rotation. Try moving line 15 below line 17. User#11440 120 — 8y

1 answer

Log in to vote
-1
Answered by
FiredDusk 1466 Moderation Voter
8 years ago

Sorry for not explaining much, I am on my pad but maybe use CFrame.Angles(). Look it up, hope it helps.

0
P-put a link on that topic!!! StoIid 364 — 8y
Ad

Answer this question