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

positon = position + vector3 works in roblox studio but not in the roblox client?

Asked by 6 years ago
Edited 6 years ago
for i=1,70 do
print("e")
script.Parent.Parent.Door.Position = script.Parent.Parent.Door.Position + Vector3.new(0,0.08,0)
wait()
end

so, im wondering why the loop works but the door isnt moving in client, it prints e 70 times but the door doesnt move, remember that its in a script, not localscript

0
dang, its been an hour nobody has replied off Thescrubbyman 2 — 6y
0
I am not a pro or anything, but I think CFrame is better than Position. mixgingengerina10 223 — 6y
0
nobody still has replied, doh! Thescrubbyman 2 — 6y

1 answer

Log in to vote
0
Answered by
Foridex 46
6 years ago

The problem is that you are using Vector3 instead of CFrame. CFrame usually works MUCH better than Vector3 for movement. Although Vector3 is a good way to make parts enlarge themselves.

Use this script:

local door = script.Parent.Parent.Door
for i=1,70 do
    print("e")
    door.CFrame = door.CFrame * CFrame.new(0,0.08,0)
    wait()
end
0
I tried it on the door, online, still doesn't work. Thescrubbyman 2 — 6y
Ad

Answer this question