I'm trying to make a part that rotates and kind of 'bobs' up and down. While it's rotating fine - the Y rotation value of the block is changing -, it doesn't move at all along the Y Axis.
local block = script.Parent
local yRotVal = 0
local yPos = block.Position.Y
local yPosTop = yPos + 5
local yPosBottom = yPos - 5
while true do
wait()
block.Rotation = Vector3.new(0,yRotVal,0)
yRotVal = yRotVal + .5
while yPos < yPosTop do --This is where the issue is
wait() --<
yPos = yPos + .5 --<
print (yPos) --<
end
end
Where it's asked to print the value of the yPos, it does this properly. The number increases by .5 each time, but the position stays the same. The output looks as follows:
1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5
, so I know it's reaching that part of the code, I'm just not sure why the Y position isn't changing. Thanks for any help!

1 comment
I can't help. I do not know how to do stuff like that. Try a bodyposition thing and make a script to change it. Using if things are helpful. Just remember that. If you want me to make you a brick as a template then just message me on ROBLOX.