Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part rotation help?

Asked by 8 years ago
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.

1
Format the code, don't obscure links 1waffle1 2908 — 8y
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. TealTeam 40 — 8y
0
Edit your post to be formatted more nicely, please. BlueTaslem 18071 — 8y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

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)
0
Thank you, I appreciate it very much. TealTeam 40 — 8y
0
what does lerp do? Vezious 310 — 8y
Ad

Answer this question