|
Here i have an inventory script that i've been working on. It works fine, but when i drop an object, its dropping an instance of it (a clone), and when i go to pick it back up, i can't re-drop it since its a clone, not a prefab. Can i make a prefab of it at runtime? Here's code: function InventoryRay() { function SubMenu() { }
(comments are locked)
|
|
I think you're taking the incorrect approach. From what I understand the real issue is that your naming convention is broken by the fact that instantiated GameObject have "(Clone)" added to their name, right? Then don't pollute your project with clone prefabs uselessly, just rename the instantiated objects so they match the original name. In your Submenu() method, simply add this line after the instantiation: so i would replace the empty quote with lets say, "object1" in this case?
Mar 26 '12 at 08:42 PM
Kag359six
actually..when i do that, it just says the prefab i want to instantiate is null... i will update the code so you can see. It also doesnt change the name in the hierarchy, or in game.?
Mar 26 '12 at 08:45 PM
Kag359six
Nevermind! i just figured it out. It was pretty much what you said but i just did this instead objectToDrop.name = currentItem; Thanks a bunch! im accepting your answer since it nearly gave me what i needed.
Mar 26 '12 at 08:56 PM
Kag359six
(comments are locked)
|
|
You can use
(comments are locked)
|
