How can i make a part face the same direction of another part

I want to make a part face the same direction that another part is facing
if part1 is facing north-east i want part 2 to face the same way (north-east)

i tried using lookvector but i keep getting errors, i dont have the code(i deleted it bc it didnt work)

I need to do this because i want to make a part face the opposite of what it was facing originally
-so if originally facing north, the script would make it look south

1 Like

try something along the lines of this:

local part1 = workspace.Part1
local part2 = workspace.Part2

part1.CFrame = (part2.CFrame - part2.Position) + part1.Position
5 Likes

i dont have another part tho just one part, i want it to face the same direction of the same part so i can make it face the opposite

yes sorry im not very good at explaining things

Hey, do you mean something like this?

Code used:

local part = script.Parent --// Part you want to change facing
local part2 = game.Workspace.Part2 --// Part direction you face towards

while wait() do
    local negativeX = part2.Orientation.X * -1
    local negativeY = (part2.Orientation.Y + 180)
    local negativeZ = part2.Orientation.Z * -1
    part.Orientation = Vector3.new(negativeX, negativeY, negativeZ)
end

Hopefully, this is what you’re looking for.

2 Likes

wefwfe23
replying to both of you; i am tring to rotate tese boots that are welded to the character, im too lazy to turn them in blender

The front face is the back of the boot

if you want to rotate it with a script just do this

    local part = script.Parent
    part.Orientation = part.Orientation + Vector3.new(0, 180, 0)
1 Like

i have trying but when the player is moving or an idle anim is playing it looks weird

23d2d3
23f2f332
It only looks normall when i am standing completly still

Just go into blender and rotate 180, it’s not worth the hassle to create a whole script just to orientate it the way you desire. It doesn’t take long to rotate something in blender.

1 Like

u could just have it to do

part1.Orientation = part2.Orientation
part2.Orientation += Vector3.new(180,0,0)

Try this, check miss spelling since this is written on phone.

part2.CFrame = CFrame.lookAt(part1.CFrame.LookVector, part1.CFrame.LookVector) 

this will rotate part2 to match part1s rotation but will not move part2 and keep it at the same position

local part1 = ...
local part2 = ...

part2.CFrame = part1.CFrame.Rotation + part2.Position
3 Likes

Part1.CFrame = CFrame.new(Part1.Position) * Part2.CFrame.Rotation

3 Likes

When you are setting C0 in your weld, multiply your CFrame with CFrame.Angles(0,180,0), that way it will rotate 180° on Y axis and it will be rotated correctly, then just some offsetting to front and you’re good to go!

Thx for this forumla FYI this works good for BodyGyro if anyone still uses it.