So I wanted to have a moving fish in my game and the script worked fine except that it resets the orientation and the fish ends up going backwards. Is there a way to fix that? Oh and, how could I make it so it rotates when it moves to the sides?
while true do
wait()
for i = 1,1000 do
script.Parent.CFrame = CFrame.new(script.Parent.Position + Vector3.new(.2,0,0))
wait()
end
for i = 1,10 do
script.Parent.CFrame = CFrame.new(script.Parent.Position + Vector3.new(0,3,0))
wait()
end
for i = 1,1000 do
script.Parent.CFrame = CFrame.new(script.Parent.Position - Vector3.new(.2,0,0))
wait()
end
for i = 1,10 do
script.Parent.CFrame = CFrame.new(script.Parent.Position - Vector3.new(0,3,0))
wait()
end
end