P
P
PsyDuckbest2021-07-31 12:16:59
Unity
PsyDuckbest, 2021-07-31 12:16:59

Why doesn't the script work if it's correct?

I'm trying to imitate real programming, so I break everything into different scripts, but here's the problem. The simplest code works if it is in a script with a character control, but if I write it in another script and also hang it on the character object, like the controller, then it stops working, there is no call to it, as far as I understand. The code is the simplest. (prefab substituted in unity)

public class PutDown : MonoBehaviour
{
    public GameObject prefab;

    public void start() {
            Instantiate(prefab);
    } 
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-07-31
@PsyDuckbest

Unity is looking for a method Start, you don't have one, so it doesn't work the way you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question