Hello, could someone please explain why this line of code doesn't work?

void moveTweenValue(Vector2 target){
			var moveTween = GetNode<Tween>("moveTween");
			moveTween.InterpolateProperty(moveTween,"position",Position,target,2,Tween.TransitionType.Quint,Tween.EaseType.Out); 
			moveTween.Start();
			//return target;
		}
		moveTweenValue(1,1);

It says "No overload for method 'moveTweenValue' takes 2 arguments".

Thanks!

  • Try this:
    moveTweenValue(new Vector2(1,1));

The function takes a Vector2 object and you are sending it 2 Integers.

You could do this:

moveTweenValue(Vector2(1,1));
  • Sabb replied to this.

    cybereality
    I was trying that already but sadly it gives this error instead:
    "Non-invocable member 'Vector2' cannot be used like a method."

    Try this:
    moveTweenValue(new Vector2(1,1));

    • Sabb replied to this.