When you try to build your Unity project, the build fails and you see an error like:

CS7036: There is no argument given that corresponds to the required formal parameter 'X' of 'SomeMethod(...)'

In the Editor you might get away with a few of these if the code path is not hit in your current scene, but the build process compiles everything, so CS7036 becomes a hard stop. This article shows you how to read the error, find the real script, and fix the method call or signature without guessing.


1. Understand What CS7036 Actually Means

CS7036 is a C# compiler error that says:

  • A method (or constructor) expects a parameter that you did not provide.
  • Somewhere in your code, you are calling that method with too few arguments.

Example:

public void SpawnEnemy(Vector3 position, int health)
{
    // ...
}

// Wrong – only one argument passed
SpawnEnemy(transform.position);

This compiles error CS7036 because SpawnEnemy requires two parameters but you only passed one.

Unity does not invent this error; it is coming from the C# compiler running during the build.


2. Read the Full Error Message and Note the Script + Line

Do not rely only on the short message in the Console. You need the full error line:

  • It will mention:
    • The file path of the script (Assets/Scripts/.../SomeScript.cs).
    • The line number where the problem call lives.
    • The method name and signature that expects more parameters.

Steps:

  1. In the Unity Console, double‑click the CS7036 entry.
  2. If Unity jumps you into a script, note:
    • The method call highlighted.
    • The method name and its arguments.
  3. If the Console only shows a short message, click the error and look at the bottom detail panel or open the full Editor log.

You want to identify two things:

  • The call site (where the method is called with missing arguments).
  • The definition (where the method is declared with its required parameters).

3. Find the Method Definition and Compare Parameters

Open the script that defines the method mentioned in the error, or right‑click the method name and choose “Go To Definition” in your IDE.

Check:

  • How many parameters does the method require?
  • What types and order do they use?
  • Are any parameters optional (have default values) or are all required?

Common patterns that cause CS7036 in Unity projects:

  • You updated a method signature (for example, added a new required parameter) but did not update all call sites.
  • You copied code from a tutorial that expects a different version of your method.
  • You overloaded methods and are now calling the wrong overload.

Your goal is to make sure that every call to this method passes the correct number and type of arguments.


4. Fix the Call Site Safely (Preferred Option)

In most Unity projects, the safest fix is to update the call site to match the current method signature.

Example:

// Method definition
public void SpawnEnemy(Vector3 position, int health)
{
    // ...
}

// Old call – missing health
SpawnEnemy(transform.position);

// Fixed call – passes both parameters
SpawnEnemy(transform.position, 100);

Guidelines:

  • Pass a sensible default value if you are not ready to drive the parameter from gameplay yet (for example, 100 health, 0 index, false flag).
  • If the parameter is a reference type, check whether you can pass:
    • An existing object reference (for example, a manager or config).
    • null only if the method explicitly handles it.

Repeat this process for every call site flagged by CS7036 (there may be several in different scripts).

Verification step:
After fixing all calls, save, let Unity recompile, and check that the CS7036 entries disappear from the Console.


5. Consider Making Parameters Optional (When Appropriate)

Sometimes you added a new parameter that is useful but not required in every context. In those cases, you can make it optional by giving it a default value:

public void SpawnEnemy(Vector3 position, int health = 100)
{
    // ...
}

Now both of these calls are valid:

SpawnEnemy(transform.position);          // health defaults to 100
SpawnEnemy(transform.position, 150);     // overrides default

Use this carefully:

  • Good for parameters that have a clear, safe default (for example, default health, default layer, default color).
  • Not good for parameters that must be specified to avoid bugs (for example, a required dependency or configuration object).

Verification step:
After making a parameter optional, recompile and ensure that existing calls work and that new code can still pass explicit values where needed.


6. Watch Out for Event Handlers and Unity Callbacks

CS7036 often appears around:

  • C# events and delegates.
  • Unity event callbacks (for example, methods attached in the Inspector).

Examples:

  • You change an event handler from void OnEvent() to void OnEvent(int value) but forget to update all subscriptions.
  • You change a method bound in a UnityEvent to require parameters; Unity still tries to call it with the old signature.

Fix strategy:

  1. Check the delegate or event type and its parameter list.
  2. Make sure every subscribed method matches that signature.
  3. For UnityEvents in the Inspector:
    • Click the event,
    • Remove broken listeners,
    • Re‑assign methods that match the current signature.

Verification step:
Play your game in the Editor and trigger the event to confirm no new CS errors appear and the callbacks fire as expected.


7. Clean Up Old or Unused Code That Fails Builds

Because builds compile all assemblies, you can get CS7036 from:

  • Old prototype scripts you no longer use.
  • Sample code from packages.
  • Editor‑only utilities accidentally included in runtime assemblies.

If a script is truly dead code:

  • Delete it, or
  • Wrap it in #if UNITY_EDITOR if it is editor‑only, or
  • Move it into an Editor folder so it compiles into an editor‑only assembly.

Do not leave broken, unused code in your project; it will keep blocking builds.

Verification step:
After cleanup, run Build again and make sure CS7036 no longer appears from those files.


8. Preventing CS7036 Errors in Future Refactors

To avoid running into CS7036 every time you change a method:

  • Use your IDE’s Rename/Change Signature refactor tools instead of hand‑editing method definitions.
  • Prefer optional parameters when adding non‑critical options to widely used methods.
  • Keep utility methods that change frequently encapsulated in one place, not sprinkled across many scripts.
  • Add small unit or play‑mode tests for core systems so you notice signature mismatches earlier than build time.

These habits make method changes more controlled and reduce the surprise of build‑breaking CS7036 errors.


Summary and Next Steps

Error CS7036 means “you are calling a method without all the required parameters”, and Unity surfaces it during builds because the C# compiler compiles everything.

To fix it, you:

  • Read the full error message to find the exact script and line.
  • Compare the call and the method definition.
  • Update call sites or make parameters optional where appropriate.
  • Clean up unused or editor‑only code that should not be in your runtime assemblies.

Once your build succeeds again, consider reviewing other help articles on Unity C# errors or build troubleshooting so you can spot and fix similar issues faster next time.

If this helped you get your build green, bookmark this page for the next refactor and share it with a teammate who keeps bumping into CS7036.