When learning the part about dragging the duplicated Paddle in the Prefabs folder to make a Prefab. I accidentally didn’t make a duplicate. I then tried to delete the Paddle Prefab and my Paddle game object is now highlighted pink in the Hierarchy. My game won’t launch the ball anymore so I think the scripts maybe can’t find it anymore. Is there a way to revert it back to before I dragged it into Prefabs folder or do I need to make it from scratch again? Thanks in advance.
It is just saying that it isnt linked to the prefab anymore, you will have to drag it to the hierarchy and configure it again to create a new prefab. The links between prefabs in the hierarchy are probably lost too.
But don’t worry, this kind of thing happens now and then.
Hi, thanks for the swift reply. Im not really sure about how to configure it again. However I just want it back as it was, without an attached prefab with (black) text in the hierarchy. Also would the problem of deleting the prefab cause my Ball launch to break? as it worked before I had made any prefabs at all.
What may happen is losing the link in the inspector between prefabs.
Just check every public variable within the inspector of this gameObject to see if some of then is null/empty
Also, what the console is displaying? It shows most of the bugs.
Sorry i am pretty noob. with the (Ball.cs:15) is the 15 the line the problem is on?
Thanks for all your help so far
Seems to have two problems, there is an variable being addressed in the 15th line of the ball script that is null. Probably in the inspector of the ball there is a variable exposedg that don’t have the value that should have, you have to drag the correct reference into this box. What is the name of the public variable in the 15th line?
The parameter within the OnCollisionEnter2D is wrong too, make sure to use Collision2D in the parentheses.
Let me know if this worked.
Thanks for your help. those two issues were fixed with your diagnosis. My paddle script was missing from my Ball GameObject. It must have removed itself after I deleted the Prefab. And yes I had Collider2D in the parentheses instead of Collision2D. I must have been confused by the fact the method above that one has Collider2D in the parentheses.
Thank you kindly
Im glad for being able to help, let us know if you need something else