Sorry if this has been posted before but I can’t figure this out. I want to offset a cframe pretty much. Heres what I have now:
local Vector3Offset = Vector3.new(2,5,0) -- 2 studs sideways, 5 studs up, 0 fowards
local CFrameOffset = Start.CFrame * Vector3Offset -- technically a vector3 despite the name
Part.CFrame = CFrameOffset -- error bc its a vector, not a cframe
This would be the perfect solution if I needed to set the parts position, not the cframe.
CFrameOffset
isn’t a cframe, its actually a vector 3. So my next idea was to just do this:
local Vector3Offset = Vector3.new(2,5,0) -- 2 studs sideways, 5 studs up, 0 fowards
local CFrameOffset = Start.CFrame * CFrame.new(Vector3Offset)
Part.CFrame = CFrameOffset
But that didn’t work either and when setting a part’s cframe to CFrameOffset
it just went to a random place.
Part.CFrame = Start.CFrame * CFrame.new(2,5,0)
My final attempt was this, and it didn’t work either.
Any ideas on how I can achieve an offset while it still being a cframe?
(Sorry if this still makes 0 sense)
TLDR: I want to achieve this effect:
local Vector3Offset = Vector3.new(2,5,0) -- 2 studs sideways, 5 studs up, 0 fowards
local CFrameOffset = Start.CFrame * Vector3Offset -- technically a vector3 despite the name
Part.CFrame = CFrameOffset -- error bc its a vector, not a cframe
But getting a cframe as the end result INSTEAD of a vector3.
btw I suck at math regarding cframes and stuff so sorry if this is super obvious