6
\$\begingroup\$

So I have this problem where I try to instantiate prefabs as in this video for example. I can take instantiate one prefab to the scene, but if I try to instantiate a second one to the scene (whether it's with the same prefab or a different one), instead of creating an instance of the second prefab, it brings the first instance I had created to my mouse and I'm in position to move it by dragging it around.

The only work around I have for this so far is to drop into the hierarchy instead of the scene (which works fine), but I have to carefully avoid the scene while dragging and dropping, otherwise the above-described issue happens instantly.

Am I doing something wrong, or is this a bug of some kind?

EDIT : I managed to reproduce the error in a consistent manner. I don't know why it happens, but it does every time. It doesn't involve code and it is very simple to reproduce (at least for me, perhaps not for you if you're not doing the wrong thing that I do...).

I created a new project. I created a cube and a sphere. I turned them both into prefabs and deleted the original instances (they have the .prefab extension in my folder, so I am sure). I drag-dropped the cube in, works fine. I drag the sphere in, and it appears as a cube which I have to position (by releasing the click), and my initial prefab instance of the cube is gone.

\$\endgroup\$
  • 1
    \$\begingroup\$ That's...odd...I don't think I've ever seen this behavior... \$\endgroup\$ – Draco18s Dec 23 '17 at 8:22
  • \$\begingroup\$ Okay, that is really a bummer for this site. I got pissed of not instantiating prefabs as a habit using the standard drag n drop method so I posted this bounty. As you asked me for a video I went and try to reproduce it... now it works fine. I don't know why or what I did wrong. Strange. \$\endgroup\$ – Patrick Da Silva Dec 26 '17 at 5:15
  • \$\begingroup\$ I was asking to just have a look, see if there was something you were doing that might account for it. But if you can't get it to happen now, I don't know what to say. Unfortunately, you can't get your bounty back. \$\endgroup\$ – Draco18s Dec 26 '17 at 7:16
  • 1
    \$\begingroup\$ @Draco18 : I don't care, at least I get to use prefabs! But I'll leave the question there ; if I manage to reproduce the issue, I'll post a video... and maybe this happened to someone, who knows! \$\endgroup\$ – Patrick Da Silva Dec 26 '17 at 7:18
  • 1
    \$\begingroup\$ @Seyed Morteza Kamaly : I highly unappreciate that you suggest to solve a very basic Unity problem (basic in the sense that the problem is not some advanced issue caused by me trying to wiggle with Unity but by using very basic ideas core to Unity) by linking me to an expensive add-on whose purpose is a mystery to me. Definitely arrogant. \$\endgroup\$ – Patrick Da Silva Dec 28 '17 at 3:43
0
\$\begingroup\$

This sounds like an issue with Unity itself. Since this is a very old post the issue is has probably been fixed, but in case anyone runs into this problem again, this is what you can do to attempt to fix it:

  1. Check which version of Unity you are using and make a note of this.
  2. Reinstall Unity and test if the issue is still present in a new project.
  3. In case the issue is still present, either update Unity to the latest version or another "stable" version.
  4. If the issue persists, contact Unity Support https://unity.com/support-services. See if the issue is already present in the issue tracker. If not, report the bug.

If the issue is solved by downgrading to a previous more stable version I also recommend reporting the bug.

Unfortunately if you get to the fourth step, solving this issue might take a while since it would have to be an issue with how your device interacts with Unity. Always make sure you don't have any other possible causes like add-ons.

If all else fails, CTRL+D duplicates any selected GameObject.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.