-1

'Component.GetComponent()' is a method, which is not valid in the given context this error in my code;

GetComponent().DOMove(finalPos,2f);

  • You didn’t provide a component type – BugFinder Sep 15 '22 at 10:42
  • You need to specify what component should be gotten. Have a look at the [documentation](https://docs.unity3d.com/ScriptReference/GameObject.GetComponent.html) to see the different ways to do it. – Voidsay Sep 15 '22 at 10:55

1 Answers1

1

Change GetComponent().DOMove(finalPos,2f); to GetComponent<ComponentYouWantToGet>().DOMove(finalPos,2f);

Hasnain Shaukat
  • 371
  • 2
  • 10