Behavior Designer Task.GetComponent doesn't support Interfaces

Visulth

New member
I'm getting an error when attempting to use GetComponent inside a Behavior Designer task to look for an Interface. I get the error that the interface cannot be used as a type parameter.

Is there a workaround for this? Could I just use Unity's Component.GetComponent instead of Task.GetComponent, or is it doing some important work behind-the-scenes?

(EDIT: using gameObject.GetComponent instead seems to work just fine for now)
 
Last edited:

Justin

Administrator
Staff member
Could I just use Unity's Component.GetComponent instead of Task.GetComponent, or is it doing some important work behind-the-scenes?
Yes, you can. The task uses the single parameter version of Unity's GetComponent.
 
Top