Game Development Community

Sun and fxSunLight Not Moving

by Jason Gossiaux · in Torque Game Engine · 11/04/2007 (1:12 pm) · 1 replies

I am noticing these two objects seem to function differently than other shapes and interiors. If I go into the console and type MainSun.elevation = 40;, the sun doesn't automatically move into the new position. I can do a MainSun.dump(); and see the elevation variable was in fact updated, but its not taking effect for some reason.

I thought this could be related to the fxSunLight not being updated to track it, but I went and manually gave that object a new elevation to match, and it failed to update either. The only way I can get the sun to update is in the editor, where I change the numbers via the console and then click on the editor bar. Its like clicking on the editor bar forces the refresh. Unfortunately that's not going to work for the game :P

Is there some method by which I should be calling an update or refresh of these objects when editing their properties? I'm just trying to manipulate the sun a bit while in game so I can test my object by object lightmap creation routines. Thanks!

#1
11/05/2007 (9:55 am)
Well I've narrowed the problem down to just be the Sun Object. I've no idea why changing its elevation via script/console doesn't take effect. However if I change the variable, then click on the object editor toolbar it pops into place :/ From looking at some of the other Day/Night packages I can't see them doing anything special.

To repeat this bug please do the following:

1). Run the mission editor and setup the sun as name = MainSun at elevation = 40 and relight.
2). Go to the console and type MainSun.setFieldValue(elevation, -6);
3). Relight, you'll notice the lightmaps don't change.
4). Click on the sun object in the object panel.
5). Relight again, you'll notice the lightmaps change.

Thanks in advance for any help with this. Its been perplexing the heck out of me.