I want it so that the a part will face where ever the player is facing or its LookVector. How can i do that. This is my attempt:
01 | while true do |
02 | local Part = Instance.new( "Part" ) |
03 | Part.Parent = workspace |
04 | Part.CanCollide = false |
05 | Part.Anchored = false |
06 | local bg = Instance.new( "BodyGyro" ) |
07 | bg.Parent = Part |
08 | bg.MaxTorque = Vector 3. new( 0 , math.huge , 0 ) |
09 | bg.CFrame = CFrame.new(Player.Character.Torso.Position, Player.Character.Torso.LookVector) |
10 | end |
1 | CFrame.new(Vector 3 pos, Vector 3 lookAt) |
You can set a part's CFrame to look at any object in the current 3D space.
All you need to do is change:
1 | Player.Character.Torso.Position, Player.Character.Torso.LookVector |
To:
1 | Player.Character.Torso.CFrame.Position, Player.Character.Torso.CFrame.LookVector |