Best way to store CFrame, since you can't store it in a CFrameValue?

As the title says, I want to store a CFrame value outside of a script, but not sure how to since CFrameValue doesn’t have a .Value property.

U can store CFrame to StringValue or not? Like StringValue.Value = ...CFrame

It does have a .Value property, but fields that accept CFrames don’t show up on the properties tab. You’ll just need to set it with scripts or the command bar.

Yes, but I can’t even see the CFrame.

Do you have to see it? :stuck_out_tongue: You know its there, and it can now be used bu scripts :slight_smile:

Of course I need to see it, otherwise I can’t keep track of them.
It’s like programming blindly without a script to read; it’s messy.

But you are reading the script? And you can just implement print() to see the value? Can also create a seperate StringValue and just ToString the cframe cant you?

You could make a StringValue and store it there perhaps?

However you can also just copy and paste it or use global environment/shared variables perhaps as well? - not recommended it’s better to just declare the variable in the scripts that you’re using.

Don’t think I can convert a CFrame value from a string value.

It’s going to be way more messy if I do it in the script, as I loop through the parts I need, which have properties inside them.

It stores where they should move to, and how long it’s going to take (inside the parts itself.)
Doing this for ex. 100 parts is not efficient enough for me, and would be way better to store it like I intended it to.

Cant you then use a table?

Just create a table and insert all your parts and their properties.

Less work if I want to duplicate more in the future, as well as removing.
So no thanks.

Solution: Create a Vector3 value, and turn it into a CFrame.

You can convert your CFrame into a table and then use JSON to save to a string value if you really need to.

local MyTable=MyCFrame:GetComponents() -- Convert CFrame to Table
local MyCFrame=CFrame.new(table.unpack(MyTable))  -- Convert Table back to CFrame
1 Like

Found a better solution for my needs, but thank you anyways.

1 Like