What would the code looks like if I want turn on/off the spotlight from script?

Requests or suggestions for new features
Post Reply
sergio_ledzep
Posts: 2
Joined: 17 Nov 2017, 15:53

What would the code looks like if I want turn on/off the spotlight from script?

Post by sergio_ledzep » 16 Jan 2018, 12:21

I have a custom UI and I just want to know what would the code looks like if i want turn on/off the spotlights every time that I press a button.

coppelia
Site Admin
Posts: 6736
Joined: 14 Dec 2012, 00:25

Re: What would the code looks like if I want turn on/off the spotlight from script?

Post by coppelia » 18 Jan 2018, 08:17

Hello,

try with:

Code: Select all

simSetLightParameters(lightObjectHandle,state)
where bit 0 of state represents the on/off flag.

Cheers

sergio_ledzep
Posts: 2
Joined: 17 Nov 2017, 15:53

Re: What would the code looks like if I want turn on/off the spotlight from script?

Post by sergio_ledzep » 24 Jan 2018, 13:15

I have this, but it still does not working

if (buttonID == 15) then
simSetLightParameters("the name of my spotlight ,0)
end

coppelia
Site Admin
Posts: 6736
Joined: 14 Dec 2012, 00:25

Re: What would the code looks like if I want turn on/off the spotlight from script?

Post by coppelia » 27 Jan 2018, 16:00

Your code doesn't say anything. What is buttonID???

Cheers

Post Reply