- Home /
What does the console mean when it says I need to attach a renderer?
I have been using the script " transform.GetComponent().enabled = true/false. Everything is fine however the console says you need to attach a renderer. Is there a renderer component that I need to attach to the object or is their another script. Thank you!
What exactly are you trying to enable/disable with the line transform.GetComponent().enabled = true/false
?
if you are getting this error you can attach the renderer to your object . however i would suggest you to post your code so that we can get clear vison of the problem ,.
A couple of things:
First, post the code and the error. The question itself doesn't provide enough information.
Second, you should always check the return value of any GetComponent() call before using it. Just to avoid null reference errors.
Your answer
