Jump to content

How to spawn a prefab instance and still apply GeNa decorators


Go to solution Solved by Bryan,

Recommended Posts

Posted

Hi!

I've set up some GeNa spawners, spawning buildings from 3D Forge "interior and exterior buildings" asset packs. I've created custom prefab variants from the base prefabs provided, and use those prefab variants in my GeNa spawners.

Having spawned some buildings, I updated my prefab variant. I noticed that my changes weren't being reflected in my GeNa spawned instances. Digging down, it would appear that the spawned Game Objects aren't prefab instances at all but "unpacked".

I'm using GeNa decorators, so I need to use the "Prefab Unpacker" to then have the "Terrain Decorator" unpacked and applied.

Is there a way to have GeNa spawn a prefab instance, so that I can update my prefab variant and have the changes reflected in spawned instances, while still having my terrain decorator applied at the point of spawn?

Many thanks again!

  • Solution
Posted
On 2/23/2022 at 5:02 AM, mroshaw said:

Hi!

I've set up some GeNa spawners, spawning buildings from 3D Forge "interior and exterior buildings" asset packs. I've created custom prefab variants from the base prefabs provided, and use those prefab variants in my GeNa spawners.

Having spawned some buildings, I updated my prefab variant. I noticed that my changes weren't being reflected in my GeNa spawned instances. Digging down, it would appear that the spawned Game Objects aren't prefab instances at all but "unpacked".

I'm using GeNa decorators, so I need to use the "Prefab Unpacker" to then have the "Terrain Decorator" unpacked and applied.

Is there a way to have GeNa spawn a prefab instance, so that I can update my prefab variant and have the changes reflected in spawned instances, while still having my terrain decorator applied at the point of spawn?

Many thanks again!

If I understand correctly, you wish to re-pack a spawned instance after you've already spawned an unpacked prefab.

This is a limitation of Unity's prefab design. We unpack a prefab when you add it to a Spawner so that we can extract the decorators inside of it and perform spawn logic where necessary. If we were to spawn Prefab Instances, your decorators inside that prefab will not be recognized by a GeNa Spawner.

Posted

Gotcha, thanks again Bryan.

So, I've added a parent GO and re-created the prefab, allowing the unpacker to get to the decorators, while still retaining the settlement and building prefabs in place. All working great!

Thanks again!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...