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

Can you change the velocity of a conveyor belt part using scripts?

Asked by 6 years ago

train = script.Parent.Train track = script.Parent.Track

script.Parent.Touched:connect(hit) if hit.Name== "Sensor" then

end

end)

This is a partial script for when the train part comes in contact with the sensor part, after that I need to slowly diminish the velocity of the conveyor belt part until the train stops at the station. Would I write it just like a transparency property? please help

1 answer

Log in to vote
0
Answered by 6 years ago

just make a For loop to slowly deminish the property value to zero.

something like this:

train = script.Parent.Train
track = script.Parent.Track
track.Velocity = Vector3.new(whatever you want it to slide like. See figure 1)
for speed = 20,0,-1 do
track.Velocity = Vector3.new(the previous number, but change one to speed. See figure 2)
end

Figure 1: (0,0,20) Figure 2: (0,0,speed)

0
Thanks!! Yutube_SB101 5 — 6y
0
oh, it actually worked? Like, first time? User#19492 0 — 6y
0
great RichardTripp 0 — 4y
Ad

Answer this question