Page 1 of 1

Increasing and decreasing

PostPosted: Tue Jan 15, 08 12:07 pm
by Andrievskaya Veronika
I want to increase DrawScale of something (in my case this is light ) and when drawScale reached some value, it starts decreasing to initial value :)

I'm trying, but this is not works. I.e. it works, but only for increasing :?

Code: Select all
function Timer()
{
 local Light L;

   Super.timer();

   ForEach AllActors(class'Light',L, 'SpecialLight')
      {
         L.DrawScale=L.DrawScale + 0.2;
            If (L.DrawScale >= 3.00)
               {
                  L.DrawScale=L.DrawScale - 0.2;
               }
      }
}


what is wrong? :oops: :oops:

PostPosted: Tue Jan 15, 08 2:45 pm
by Alex
Code: Select all
function Timer()
{
  local Light L;

  Super.Timer();

  ForEach AllActors(Class'Light', L, 'SpecialLight')
  {
    if(L != None)
    {
      L.DrawScale += 0.2;
      if(L.DrawScale >= 3.00)
        L.DrawScale -= 0.4;
    }
  }
}