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

How do I get this to move in motion rather than jumping to a vector3 number?

Asked by
tanzane 100
9 years ago
for i = 1, 5, .5 do 
wait(1) 
        script.Parent.Rotation = script.Parent.Rotation + Vector3.new(0,-10,0)
wait(3)
script.Parent.Rotation = script.Parent.Rotation + Vector3.new(0,-10,0)

end

The Title may not seem like it makes sense, but what I'm trying to do is. I was trying to make this "Strand" of grass to tilt, left to right. Or at least look like it is doing that. Everytime I do this script it goes directly to -90 on the Y-AXIS and then goes directly to -80 on the Y-Axis. And if I put this script in a While True Do will the the script continuously do the script again while keeping the same flow? Thanks for the help. If you don't understand, "Comment."

1 answer

Log in to vote
0
Answered by 9 years ago

This script will do something like that, you can change these numbers to finetune the movement. Lets say you do for i = 1, 20 do at line 2 then you change the -1 at line 4 to -0.5

function tilt() -- We add this to a function so it can be called more then once
    for i = 1, 10 do -- We make a loop at let it run 10 times
        wait(0.1) -- Wait for a short period
        script.Parent.Rotation = script.Parent.Rotation + Vector3.new(0,-1,0) -- Rotate just a bit
    end
end

tilt()
wait(3)
tilt()
0
WOuldn't that tilt in just one direction? iaz3 190 — 9y
0
You can subtract the Vector3 if you want to rotate the other direction. Merely 2122 — 9y
0
Isn't that the way he made his script? damagex443 325 — 9y
Ad

Answer this question