Game Development Community

PointLight doesn't refresh when isEnabled set to true

by Agustin Conde · in Torque X 3D · 07/16/2010 (4:11 pm) · 4 replies

Hello everyone

In the world editor I created a pointLight named pointLight1. By default it is not enabled (isEnabled equal to false). Then on my trigger I have pointLight1.isEnabled=1; and when the trigger is activated, it actually sets to true the isEnabled property of the light, but it doesn't turn on!!! Am I missing some call to an update/refresh function?

#1
07/16/2010 (6:41 pm)
I just played with it via the console and got it to work just fine. Couple noob questions...

The property is actually "IsEnabled" not "isEnabled"... I made that mistake a couple of times x.x

When IsEnabled is set, it automatically (or should!) refresh the light list.

Also, this pointLight1 is the name for the T3DLightComponent, and not the TorqueObject, is it?

Let me know of I actually need to play with it through a trigger to get your results... also seeing a bit of your trigger may help.
#2
07/16/2010 (7:31 pm)
I solved my problem. You have to call pointLight1.setLightEnabled(true); and that's all. I can't believe that you can't find that simple line of code in the entire internet. I had to find it myself calling the dump() method. Torque 3D documentation SUCKS!!!! the actual documentation doesn't event tell you to use dump()! It's so sad.
#3
07/16/2010 (7:40 pm)
@Agustin - You realize your not in the right forum? This is the forum for Torque X 3D which is the C# version of Torque for XNA.

You seem to be needing help with Torque 3D which is the C++ engine.
#4
07/16/2010 (7:43 pm)
I searched in that forum and I couldnt find an answer. Some threads were private so I couldn't see them. And I was asking for Torque Script, not the C++ engine. I just have the demo version so I don't care about C++ cause in the demo version is not the source code.