Fullstop Media
Fullstop Media

Reputation: 1

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

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

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

Upvotes: -1

Views: 40

Answers (1)

Hasnain Shaukat
Hasnain Shaukat

Reputation: 379

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

Upvotes: 1

Related Questions