Hi,
I believe there is a bug in Unity at the moment. I’m using version 4.3.1f.
At the moment it is not possible to select any Prefab with Rigidbody2D applied to it, through the editor, when you are trying to link the object to a public class in a script.
To elaborate; I have a C# script with a public class:
public Rigidbody2D nameofobject;
I have a prefab within Unity which I want to use. In the Inspector panel I locate the script component, click on the small circle to see the list of valid Rigidbody2D items that can be applied and the editor is empty.
I downloaded the example 2D platformer project from Unity and the same issue exists. If you open up the Gun and go to the field where they have the rocket assigned to the gun as a Rigidbody2D prefab. Clicking on that will show an empty editor window and if you select None, then you cannot reassign the prefab to the script component. It doesn’t work.
To show you what I mean:
Either I am doing something wrong with the class call, which I doubt since it’s exactly the same as in the example from Unity, or it would seem this is bugged. If anyone could confirm this, that would be great.
I think this was working in 4.3 as I was previously able to assign the prefab. After upgrading to 4.3.1f I started getting a “Object reference not set to an instance of an object”, which was strange since the prefab would appear in the scene when Instantiated. I changed the class to gameObject, which worked, but changing back to Rigidbody2D I was no longer able to select any prefabs.
Sorry if this is something trivial on my end. Thanks.
