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

How would I combine the components of 2 Cframes?

Asked by 5 years ago

I want to combine the XYZ of a part's CFrame and the R00-R22 of a part's CFrame multiplied by another parts CFrame.

In short, I want to know how you would combine the XYZ of one CFrame and the R00-R22 of another CFrame. How would I attempt this?

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
5 years ago

If i'm understanding you correctly you want to take the position of one part and combine it with the cframe's orientation components of another.

You can do this by creating a new cframe and multiplying it with another (combining it)

local pos=part1.Position

--I subtracted the position component of part2's cframe to get only the orientation.
local ori=part2.CFrame
ori=ori-ori.p

local cf=CFrame.new(pos)*ori
0
Kinda. It's for a weld.C1 value. I im trying to do weld.C1 = Part1.CFrame*Part2.CFrame, but I want the original xyz of Part1 to be the xyz of weld.C1. DreamInspired 61 — 5y
Ad

Answer this question