1. Home
  2. UE5 Compilation Errors
  3. UE5 C++ Compilation Error...
  4. C2660: Function doesn’t take N arguments

C2660: Function doesn’t take N arguments

What It Means & How to Fix It


🧠 Why You’re Seeing This Error

The C2660 error means you’re calling a function and giving it too many, too few, or the wrong number of arguments. The compiler looked up the function and found one by that name — but the parameters don’t match any of the defined overloads.

In UE5, this typically happens when:

  • You call an engine function like GetWorldTimerManager().SetTimer() with the wrong number of arguments
  • You update a function’s signature in the .h file but forget to update all the call sites
  • You forget optional parameters or misuse overloads

💥 Example Error Message

error C2660: 'SetActorLocation': function does not take 3 arguments

🛠️ Example Code

AActor* Actor = GetOwner();
Actor->SetActorLocation(100.f, 200.f, 300.f); // ❌ C2660: wrong number of args

✅ How to Fix C2660 in UE5 – Step-by-Step


✔️ 1. Check the Function’s Definition or Hover in IDE

Unreal Engine’s SetActorLocation() expects a single FVector, not three floats.

Fix:

FVector NewLocation(100.f, 200.f, 300.f);
Actor->SetActorLocation(NewLocation); // ✅ Correct argument count

✔️ 2. Check if the Function Has Overloads or Optional Parameters

Sometimes you’re passing too many or too few arguments for a specific overload.

Example:

GetWorld()->SpawnActor(ActorClass); // ❌ Might be missing required parameters

Fix:

FVector Location = FVector::ZeroVector;
FRotator Rotation = FRotator::ZeroRotator;
GetWorld()->SpawnActor(ActorClass, Location, Rotation); // ✅ Full signature

✔️ 3. Check All Call Sites After Changing Function Signatures

If you changed the arguments of a function you declared in .h, don’t forget to update every place that calls it.

Wrong:

// You changed the declaration to require a float
void SetSpeed(float NewSpeed);

But still using it like:

SetSpeed(); // ❌ C2660: function now requires 1 argument

Fix:

SetSpeed(600.f); // ✅

✅ Summary: How to Fix C2660 in UE5

CauseFix Example
Wrong number of argumentsCheck function signature and match required parameters
Passing multiple values instead of oneUse a FVector or FRotator object as expected
Signature updated but call not updatedUpdate all call sites when function declarations change
Wrong overload calledUse correct overload or provide default parameters if needed
Was this article helpful to you? Yes No

How can we help?