Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Part rotation help?

workspace.Par.Size=Vector3.new(.6,.6,(workspace.Part1.Position-workspace.Part2.Position).magnitude) workspace.Par.CFrame=workspace.Part1.CFrame:lerp(workspace.Part2.CFrame,.5)

I ran that code and I want the "Par" brick to connect "Part1" and "Part2". However, I get this instead of the parts being connected. Click Here for Picture Any help would be greatly appreciated.

3 comments

1

Format the code, don't obscure links

0

Sorry, that link is like that because I copied it from what I posted on the forums. They don't help, so I just posted it here.

0

Edit your post to be formatted more nicely, please.

1 answer

✓ Accepted answer

Your code interpolates the CFrame. The new CFrame is not oriented any differently than the two un-rotated parts. If you want to set the direction the CFrame is facing, use the two-point constructor:

workspace.Par.CFrame=CFrame.new(workspace.Part1.Position:lerp(workspace.Part2.Position,.5),workspace.Part2.Position)

2 comments

0

Thank you, I appreciate it very much.

0

what does lerp do?

This discussion is preserved as it was. New answers, comments, and votes are closed.