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

Why does my door move up when I use CFrame to move down?

Asked by 7 years ago

So I was coding a door to move down when a button was pressed. To test my code, I used a loop and a wait to control the door. But whenever I hit test, regardless of what I put in the parenthesis, the door just moves up. Does anyone know why? Thanks.

part = script.Parent
for i = 1,100 do
    part.CFrame = CFrame.new(part.Position + Vector3.new(0,-1,0))
    wait(5)
end

1 answer

Log in to vote
0
Answered by 7 years ago

The part you want to move is upside down ? I've noticed with doors .CFrame is specific and moves the part according to X,Y,Z positioning. A rotation of your part should help. Often times I have to resize my part so that it moves the way I want it to go

0
Also check the rotation of the part dallylogan 29 — 7y
0
I changed the part the script moved and the door started to work! Thanks. JarFullOfMayonnaise 48 — 7y
0
Your welcome :) glad someone wasn't rude to me for tryin to help ???? dallylogan 29 — 7y
Ad

Answer this question