I want to use a "control button" model to change a conveyors velocity but I can't understand completely how to do it...
belt = game.workspace.bunnyhill --location of the conveyor function onclick() if mode = "on" then belt.vector3 = 0,0,20 -- attempt to toggle "belt" z velocity to 20 elseif mode = "off" then belt.vector3 = 0,0,0 --attempt to toggle "belt" z velocity to 0
^Code attempt to toggle conveyor on/off It keeps erroring out saying that it cannot find this property in the part
Not sure how to use vector3 exactly... I've looked at a bunch of websites and none of them explained it clear enough so I decided to come here for answers. If you could help me understand this better I'd appreciate it a lot! --Thanks, RingedAsh43
Vector3
is a roblox's data type, which, like any other one can be created by using the new()
function of it, like this:
Vector3.new(1,0,0)
So, in order to set the velocity of something, you would do this:
belt.Velocity = Vector3.new(0,0,20)
Read more about Vector3 here