'Component.GetComponent<T>()' is a method, which is not valid in the given context

35 Views Asked by At

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

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

1

There are 1 best solutions below

0
Hasnain Shaukat On

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