Answer the question
In order to leave comments, you need to log in
Is it possible to use an instancer inside a constructor?
Is it possible to do this, or is it a bad idea?
public class Example : MonoBehaviour
{
Example(params)
{
Instantiate(this.gameObject);
// some code here
}
}
Answer the question
In order to leave comments, you need to log in
Bad exactly because MonoBehaviour descendants cannot use a constructor. And the phrase "call the constructor" put me personally in a stupor))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question