Search Unity

Error CS1501

Discussion in 'Scripting' started by renman3000, Sep 19, 2013.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Hi there,
    Why am I getting this error?

    It states that, "error CS1501: No overload for method `InvokeRepeating' takes `1' arguments"

    Here is my code.
    Code (csharp):
    1.  
    2. InvokeRepeating("tapForFire");
    3.  
    Here is the full code. I am not sure it has anything to do with the fact it is Update(with breakers).
    Code (csharp):
    1.  
    2.     ///for Web and Desktop use, keyboad must act as second control. (tap, left side of screen).
    3.     void Update() {
    4.         if (Input.GetKeyDown(KeyCode.X)){
    5.             if(!gunFireEnabled){
    6.                 gunFireEnabled = true;
    7.                 InvokeRepeating("tapForFire");
    8.                 return;
    9.             }        
    10.         }
    11.     }
    12.  
     
  2. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
  3. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    OMG,
    I think I did not have Coffee.
    Thanks
     
  4. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    InvokeRepeating in Update is also a really bad idea as it will start a new invocation every frame that condition is true.