I want to check the dialog display. I've thought about a code like: "
Code: Select all
if dialog_A is displaying then sim.endDialog(dialog_A) end
Code: Select all
if dialog_A is displaying then sim.endDialog(dialog_A) end
Code: Select all
local current_state=sim.checkCollision(car_body,wall_1)
if(current_state==1 and last_collision_state==0 and collide_start_T==0)then ---record state collisiont time
collide_start_T=simulationtime
dialog_H=sim.displayDialog('Attention','Colliding with wall',sim.dlgstyle_message,true)
end
if(untouch_times<6) then
else
collisionTimes=collisionTimes+1
collide_start_T=0
untouch_times=0
sim.endDialog(dialog_H)
end