Errors that i can't resolve after adding rigidbody code

Followed the lesson step by step but after adding all the rigidbody Unity asked me to update the assets (?) or something. Probably shouldn’t have said yes because now these errors have appeared. I tried deleting the script, deleting the rigidbody parts, tried looking for that “Bee” artifact (with no success)… I have no clue what is going on

This is my script:

{
MeshRenderer rederer;
Rigidbody rigidbody;
[SerializeField] float timeToWait = 2f;

// Start is called before the first frame update
void Start()
{
    renderer = GetComponent<MeshRenderer>();
    rigidbody = GetComponent<Rigidbody>();

    renderer.enabled = false;
    rigidbody.useGravity = false;
}

// Update is called once per frame
void Update()
{
    if(Time.time > timeToWait)
    {
        renderer.enabled = true;
        rigidbody.useGravity = true;
    }
}

}

Welcome to the community, @Pegaso

You have a typo, so unity is assuming you want to use the old renderer that used to be available (still is, but obsolete).

your variable here is misspelled. Changing it to renderer should fix the issue

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms