Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why can't I access some functions in Visual Studio working with Unity?

Discussion in 'Scripting' started by Pocknell-r251, Jun 24, 2020.

  1. Pocknell-r251

    Pocknell-r251

    Joined:
    Jun 19, 2020
    Posts:
    16
    I'm following a tutorial on quest making, and the YouTuber uses the List.Clear() function, and List.Add() function, perfectly well and without any errors.
    I use them and I get "Error CS7036 There is no argument given that corresponds to the required formal parameter 'array' of 'Array.Clear(Array, int, int)' "
    and
    "Error CS1061 'string[]' does not contain a definition for 'Add' and no accessible extension method 'Add' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?).
    The tutorial guy uses no references or arguments, and his code works fine. I'm so confused and don't know what I'm doing wrong at this point - is there some language I'm missing or something??
    Pls help xx
     
  2. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    post your code :D
     
  3. raarc

    raarc

    Joined:
    Jun 15, 2020
    Posts:
    535
    looks like you are using arrays instead of lists.
     
  4. Pocknell-r251

    Pocknell-r251

    Joined:
    Jun 19, 2020
    Posts:
    16
    Never mind guys this one was just me being tired and dumb - thanks for the messages anyway! :)
    I completely overlooked this as I hadn't slept in like 24 hours :') Sometimes the errors are with ourselves lmao xx