Search Unity

C# InvokeRepeating, has some invalid arguments

Discussion in 'Scripting' started by renman3000, Aug 28, 2012.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    In a C# script I have this...

    Code (csharp):
    1.  
    2. InvokeRepeating("slowTween", 0.1, tSTF);
    3.  
    where the tSTF is a float, however I am told that this argument list has some invalid elements.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    You need to use
    Code (csharp):
    1. InvokeRepeating("slowTween", 0.1f, tSTF);
    The "f" indicates that the value is a float rather than a double.
     
  3. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    thanks.