why does the timer not work ???

Hello !!!
There is a camera in the scene -- PhysCamera001.
I'm trying to change her parameter

try (DestroyDialog Dist) catch()
rollout Dist "Dist" width:90 height:50
(
local CamPar = $PhysCamera001.clip_near
checkbutton cbn_Plus "+" checked:false tooltip:"Far from Camera"
timer MC "P" interval:10 active:false

on Dist open do
(
$PhysCamera001.clip_on = true
)
on cbn_Plus changed theState do
(
if ( cbn_Plus.checked == true ) then
(
MC.active = true
)
else
(
MC.active = false
)
)
on MC tick do
(
CamPar += 1
)
on Dist close do
(
$PhysCamera001.clip_on = off
)
)
createDialog Dist

why does the timer not work ???

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

The timer works:

try (DestroyDialog Dist) catch()
rollout Dist "Dist" width:90 height:50
(
	local CamPar = $PhysCamera001.clip_near
	checkbutton cbn_Plus "+" checked:false tooltip:"Far from Camera"
	timer MC "P" interval:1000 active:false
 
	on Dist open do
	(
		$PhysCamera001.clip_on = true
	)
 
	on cbn_Plus changed theState do
	(
		if ( cbn_Plus.checked == true ) then
		(
			MC.active = true
		)
		else
		(
			MC.active = false
		)
	)
 
	on MC tick do
	(
-- 		CamPar += 1
		$PhysCamera001.clip_near += 1
		format "nc: % \n" $PhysCamera001.clip_near
	)
 
	on Dist close do
	(
		$PhysCamera001.clip_on = off
		MC.active = false
	)
)
createDialog Dist

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.