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

How to add X/Z/Y Values to a CFrame?

Asked by 5 years ago

I want to make my CFrame Y value to change, and only that XYZ value to change.

Please help me with it! I've tried to code it here it is:

script.Parent.CFrame.Y = script.Parent.CFrame.Y + 20

1 answer

Log in to vote
0
Answered by
CPF2 406 Moderation Voter
5 years ago

CFrame:ToWorldSpace()

In your situation, you'd use it like this,

script.Parent.CFrame = script.Parent.CFrame:ToWorldSpace(CFrame.new(0,20,0))
0
Thank you so much! TechGamar 30 — 5y
0
Tech remember to click "Accept Answer", so that it gets marked as solved and people can find the answer to this question later. Formidable_Beast 197 — 5y
Ad

Answer this question