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

How do I CFrame something without using coordinates?

Asked by 10 years ago

For example, you can use the Position property to add a Vector3 to a part's position like this:

part = script.Parent

while true do
    part.Position =  part.Position + Vector3.new(0, 1, 0)
    end

That would make my part go up, but if something was in the way, it would teleport over the something. I would like to know how to do something like that with CFrame values.

Is my question confusing, or a solution impossible to provide?

1 answer

Log in to vote
1
Answered by
acecateer 130
10 years ago

This is what you'd do buddy:

part = script.Parent

while true do
    wait(0.1) --Wait times are always good to have, it prevents the game from crashing and helps prevent lag.
    part.CFrame =  part.CFrame * CFrame.new(0, 1, 0)
end

0
Thanks, man! I'd just forgotten to add the wait. Lightdrago 95 — 10y
Ad

Answer this question