Forum rules - please read before posting.

XXX won't be instantiated, as it is already present in the scene.

I have 2 entirely different prefabs that I object->add, the problem is if one is already in the world, the second one wont add. It says XXX won't be instantiated, as it is already present in the scene. They are different prefabs with different names and objects inside so why is this happening?

Comments

  • Try checking the constant IDs. Make sure both prefabs have different constant ids else AC will think it's the same object (Constant Ids are AC's method to deal with disabled or instantiated objects, but it only works for unique objects).
  • Arent they set by AC tough? If they are the same how do I change them? Cheers.
  • You can just check the ConstantID script in each prefab. Make sure Retain in Prefab is ticked in both of them. Anyway, as far as I know AC can automatically change the constant ids of an object, if both objects are in the hierarchy and are found to be duplicates. But I doubt this works if the objects in question are prefabs in the project folders. This kind of mistake is possible if one duplicates a prefab in the project view and uses it as a base to make another one (it could also be a coincidence, though, in the case Retain in Prefab is not ticked and both keep the same default value for example). To double check, just put both prefabs in the scene hierarchy, AC will instantly post a comment in the console and change the constant Id in one of the objects in the case that they actually have duplicate Constant Ids.

    If the ConstantIds look fine (different for each), then we may need to look for other possibilities.

    PS: you can set the Ids yourself if you go to the ConstantID script and then in "Set" select "Manual". That way you'll be able to enter whatever number you wish.
  • Thank you, that is the exact problem, and it was caused by duplicating. Real shame AC/Unity cannot give them unique IDs automatically when you do this. 

    But I did get unique ids - I set constant id to manual, then turned off retain in prefab then went back to automatically. This seemed to generate unique ids for each prefab now. The strange thing is now it allows multiple instances of the same prefab to be made (even though they have the same id) I actually wanted it to not allow things with the same id, as it was doing before. Any ideas how I do that?
  • AC will ensure no two automatically-set IDs are the same within the same scene, but it's not possible to (and its arguable that it shouldn't) do this with asset files.

    Let's see some images of the prefabs you're instantiating as well as the ActionList (asset or scene-based?) you're calling.  Version numbers of AC and Unity too, please.
  • Umm, weird... Anyway, make sure to tick Retain in prefab again after you have set the new Ids, else changes to the Id made in the hierarchy won't be retained in the prefab. It may be that new instances are getting new Ids? As far as I know AC doesn't like multiple instances of the same object (unless Chris has changed this already?). 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.