Hello, I am trying to make a part face another part (e.g. a part behind face the rotated part infront)
I have tried too find answers over google but nothing then messed with LookVectors and stuff but no.
Any help will be appreciated.
Zonix.
Well, this is pretty easy to accomplish. Suppose you want Part A to face Part B.
PartA.CFrame = CFrame.new(PartA.Position, PartB.Position)
--The first constructor of CFrame.new() describes where the part is while the
--second constructor describes the position it is facing.
1 Like
On this page might help too:
ROBLOX CFRAMES
In particular:
- local redBlock = game.Workspace.RedBlock
- local blueCube = game.Workspace.BlueCube
- – Create a Vector3 for both the start position and target position
- local startPosition = Vector3.new(0, 3, 0)
- local targetPosition = blueCube.Position
- – Put the red block at ‘startPosition’ and point its front surface at ‘targetPosition’
- redBlock.CFrame = CFrame.new(startPosition, targetPosition)