Basically, I'm trying to rotate a character torso to turn towards the face of another brick, making the player parallel to the part. What's the best way to do this?
When creating a CFrame using
CFrame.new(pos, lookAt)
it accepts two arguments. The first (pos) is a Vector3 position which is the location of the CFrame. The second (lookAt), is a Vector3 position which, if included, will be the position which the CFrame is facing. Thus, you can use:
lookAt = workspace.LookAtMe.Position Torso.CFrame = CFrame.new(Torso.Position, lookAt)
The Front face of Torso will now be facing LookAtMe.
EDIT: To make the player parallel to the part, it depends on where the player is relative to the part.
If the "giant, long wall" has its Front face facing towards the player, then:
lookAt = Torso.Position - workspace.LookAtMe.CFrame.lookVector Torso.CFrame = CFrame.new(Torso.Position, lookAt)
Alternatively, if other faces are facing the player, a different lookAt would be required:
lookAt = Torso.Position + workspace.LookAtMe.CFrame.lookVector --Back facing player lookAt = Torso.Position - workspace.LookAtMe.CFrame.rightVector --Right side facing player lookAt = Torso.Position + workspace.LookAtMe.CFrame.rightVector --Left side facing player lookAt = Torso.Position - workspace.LookAtMe.CFrame.upVector --Top facing player lookAt = Torso.Position + workspace.LookAtMe.CFrame.upVector --Bottom facing player
Using a BodyGyro might be the easiest way to accomplish what you are trying to do. You can read the wiki page here (The bottom example provides a good demonstration of how it is used): http://wiki.roblox.com/index.php?title=API:Class/BodyGyro