Using an obsolete ..thing

Hello, I am new. I was trying to recreate the Dropper script (to have the blocks fall down after X seconds) on my own, on a newer version of unity. I am getting the error "error CS0619: ‘Component.renderer’ is obsolete: ‘Property renderer has been deprecated. Use GetComponent() instead. (UnityUpgradable)’ "

I am not too sure what this says, I feel like it is telling me what to do but at the same time it is not. How can I fix this problem?

The line that is not working is- renderer = GetComponent();

You got it almost right, the only part that you got wrong was GetComponent, it is incomplete, you have to declare which type of component you want to get.

renderer = GetComponent<Renderer>();

Here’s the documentation if you want to look further into it.

1 Like

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

Privacy & Terms