Is it possible to convert Vector3 into Cframe?

I have a script that stores Vector3 values into a datastore, but I need to use those values in SetPrimaryPartCFrame(). Is there a way to convert those values to be CFrames?

1 Like

The CFrame.new() constructor can accept a Vector3 object.

CFrame.new([your vector3 object here])

To use SetPrimaryPartCFrame, you can do the following.

Model:SetPrimaryPartCFrame(CFrame.new([vector3 object]))

Also, consider using :PivotTo instead of :SetPrimaryPartCFrame because SetPrimaryPartCFrame is deprecated.

I mean no ill intent but in the future you might want to at least search this up first in Google or even an instant lookup of CFrame will immediately give you the answer.

I’ll try this. I’ve just gotta fix a new bug now where the values aren’t being saved and everything is spitting out as nil