Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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()

3 comments

0

WOuldn't that tilt in just one direction?

0

You can subtract the Vector3 if you want to rotate the other direction.

0

Isn't that the way he made his script?

This discussion is preserved as it was. New answers, comments, and votes are closed.