How to use lookVector to orientate a new part? [SOLVED]
For simplicity lets say i am creating a new WedgePart in front of the player.
How do i rotate the new part so that it is facing the same direction as the player?
I tried .Orientation as per the code below, however this rotates relative to the map xyz.
The best i can figure on my own is that i need to use the lookvector of the player, however never using one yet i have failed to get anywhere.
Thanks in advance.
1 | local part = Instance.new( 'WedgePart' , game.Workspace) |
3 | part.CFrame = player.Character.PrimaryPart.CFrame * CFrame.new( 0 , 0 ,- 5 ) |
4 | part.Size = Vector 3. new( 10 , 15 , 15 ) |
5 | part.Orientation = Vector 3. new( 0 , 180 , 0 ) |
6 | part.BrickColor = BrickColor.Random() |
9 | part.Material = 'Plastic' |