Jump to content

Broken Automatic prefab assign to terrain using multiterrain


SwenSVK
Go to solution Solved by Marcin Debicki,

Recommended Posts

Hello guys,

I have come across very frustrating thing in Gaia Pro 2021. Using Gaia Pro 2021 up to date with multiterrain load manager (5x5 x 1024 terrains) and Unity 2021.2.7f1.

Basically when I drag and drop prefab from Project folder to the scene the prefab automatically assign to the first terrain in Hierarchy order and it gets copy of the terrain transform position, which means it relocates the prefab to one place. It happens immediately after any other action is done after placement (mouse scroll, click to other gameObject, play button, anything). No matter what terrain I have chosen before I place the prefab, no matter what prefab I use (I also tried to create empty objects - same result). Even after I change the position again, its keep relocating at the same transform position.

 

Only temporal solution is to drag the prefab under another terrain (mostly the one I want to be part of) and then relocate the prefab to my desired position. But you can imagine how long it takes to place one prefab using this workflow. Minutes for one prefab instead of drag and drop in few seconds. Level design is impossible at this state.

 

It is happening only when using Gaia terrain. In another projects without Gaia is working fine. In another scene of the same project but with default terrain is working fine. So the problem is when using Gaia made terrain. I would expect that when I drag and drop prefab it should assign to the terrain I am placing it, but no. It assign to the first terrain hierarchy and then it keeps the transform no matter what I do.

Thank you for the answer. It is frustrating and it is preventing me from continuing my work.
(sorry for the watermark, had to resize the video)

Link to comment
Share on other sites

30 minutes ago, tbunreal said:

try to right click the scene and say set active,  or unload the other scenes with the terrain loader.

In that case the prefab is indeed assign to the active scene / terrain but it still gets relocated - this time its get copy of the active terrain transform position. So it solves only one part of the problem which is terrain assigning, but not the relocating problem sadly.

Link to comment
Share on other sites

Hmm, I probably don't know much more than you do haha... Maybe try putting an empty object into the terrain as a child, and then drag your prefabs into that.

Link to comment
Share on other sites

34 minutes ago, tbunreal said:

Hmm, I probably don't know much more than you do haha... Maybe try putting an empty object into the terrain as a child, and then drag your prefabs into that.

I do not suppose this is how it should work honestly. Lest wait for devs 🙂

Link to comment
Share on other sites

Hi @SwenSVK the position in the hierarchy that is chosen when you drag an object into the scene is standard unity behavior, it will be placed somewhere in the hierarchy in the active scene. The active scene is the one printed in bold in the list of scenes in the scene hierarchy, you can choose what the currently active scene is by right clicking on it in the scene hierarchy:

image.png

The repositioning is a Gaia thing and has technical reasons, it is possible that the terrains contained in the terrains scenes are displayed in a different position than what is stored in the terrain scene file e.g. when using the floating point fix for large scenes. Gaia will therefore reposition all top level objects of a terrain scene to be positioned in the correct spot. You would need to make those objects childs of the terrain in question.

Note that this would automatically be solved if you would spawn these objects with Gaia as they would be spawned in an container object below the terrain in the hierarchy already.

Link to comment
Share on other sites

  • Solution

Another workaround/solution is to add empty game object to terrain to be edited and set it as default parent. This can also be used without extra object, just set terrain as default parent.

Link to comment
Share on other sites

On 2/21/2022 at 6:31 PM, Peter said:

Hi @SwenSVK the position in the hierarchy that is chosen when you drag an object into the scene is standard unity behavior, it will be placed somewhere in the hierarchy in the active scene. 

23 hours ago, Marcin Debicki said:

Another workaround/solution is to add empty game object to terrain to be edited and set it as default parent. This can also be used without extra object, just set terrain as default parent.

Thank you guys for this info. I already tried to use "set active scene" but it acted the same. Creating the gameobject under the terrain and setting that as default parent did the magic. This workflow kinda mentioned also @tbunreal but I understood him that I need to drag those prefabs under the Parent gameobject. Setting as default parent made it bit easier to work.

So it seems working so far. If anything I will ping once again. Thank you for clarification and help here!

Link to comment
Share on other sites

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...