How do you enable a light with ms?

How do you enable a light with ms?

Anonymous
Not applicable
211 Views
1 Reply
Message 1 of 2

How do you enable a light with ms?

Anonymous
Not applicable
I've been trying to enable lights through ms and just can't get it to work. I have a hard coded array of lights. I randomly choose which spot of the array to look at and then try to enable that light.

redLights = #($r1,$r2,$r3)

randNum = random 1 3

redLights.enabled = true

I've tried many combinations of the last line of code with no success. I keep getting undefined errors, enabled property doesn't exist, and so on. So how do I make this work?
0 Likes
212 Views
1 Reply
Reply (1)
Message 2 of 2

Steve_Curley
Mentor
Mentor
You do have 3 lights in the scene called "r1", "r2" and "r3"?

Other than that there's no reason for that code not to work as it stands.

If you're doing that in the Listener dialog, select all 3 lines then press Enter on the Numeric Keypad. Works perfectly here.


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes