sim=require'sim'
function sysCall_init()
self=sim.getObject('.')
sensor=sim.getObject('./_sensor')
end
function sysCall_actuation()
beltVelocity=0
if sim.readProximitySensor(sensor) > 0 then
sim.wait(2)
belVelocity=0.7
end
sim.writeCustomTableData(self,'__ctrl__',{vel=beltVelocity})
end
Either check the value returned by sim.getSimulationTime (e.g.: set belVelocity only if t>2), or use a threaded script instead where you can use sim.wait.