Hscript if expression to return value in parameter
13306
2
2
-
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
How do I get a hscript if statement in a parameter to return a value? What I would like to do is basically:
if ( “distance from camera” < 10 ) then
return 0
else if (“distance from camera” > 100 ) then
return 2
else then
return 1
endif
I have the “distance from camera” part worked out. I only need to know how to set the parameter to the value I try to return in my if statements.
-
- stevenong
- Member
- 1631 posts
- Joined: July 2005
- Offline
Hi xtimmyx,
I think this should work:
if(“distance from camera” < 10, 0, if(“distance from camera” > 100, 2, 1) )
Cheers!
steven
-
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
stevenong
Hi xtimmyx,
I think this should work:
if(“distance from camera” < 10, 0, if(“distance from camera” > 100, 2, 1) )
Cheers!
steven
It worked just perfect, what a wonderful little expression.