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

How to I make only the y axis move?

Asked by 5 years ago

I want only the y axis to move so that whnever i move the x and z axis it automatically goes up from there instead of being fixed

bodyPos = script.Parent 
Part = script.Parent.Parent
while wait() do
bodyPos.Position = Vector3.new(Part.Position,math.random(0,100),Part.Position)
end

1 answer

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
5 years ago
Edited 5 years ago
bodyPos = script.Parent 
Part = script.Parent.Parent
while wait() do
bodyPos.Position = Vector3.new(Part.Position.X,math.random(0,100),Part.Position.Z)
end

You forgot to add the X/Z values

Ad

Answer this question