mesh decorator question

   5422   7   1
User Avatar
Member
7 posts
Joined: May 2015
Offline
I made a mesh decorator object using this dungone as the ‘mesh object’. It
spread the items throughout the dungeon but none were on the floor.(the shot is
after I put them all on the floor).
There's
something in the video about ‘snap it to the terrain’. Is this possible for dungeon
type meshes also?

Attachments:
mesh_decorator.jpg (68.5 KB)

User Avatar
Member
402 posts
Joined: March 2013
Offline
Not sure about your setup, but in my test, I just place a large Unity sphere underneath the ground plane and then drag the sphere GameObject to the Mesh Object parameter (in the Inputs section) on the Mesh Decorator asset. All the instances then glue themselves to the sphere's surface.

Under the Controls tab on the Mesh Decorator, there are two options that can help fix this. “Lift Source Mesh” will increase the distance the asset looks for a snappable mesh (even if the mesh is given as an Input, the asset won't search infinitely for it). And “Flip Src Proj Dir” will change the direction the asset looks in for snapping the instances. I think 0 is Down and 1 and above is Up.
User Avatar
Member
7 posts
Joined: May 2015
Offline
I think it only works on flat meshes, when I pick the maze dungeon, it
glues to all sides, floors walls ceilings. I'd have to separate out each floor. Might
as well just use the default flat mesh, make my props on a per floor basis, then
drag out the props from the mesh decorator scripts into the main hierarchy,
remove ‘houdini component’ from them all.

Attachments:
glue_to_every_surface.jpg (87.5 KB)

User Avatar
Member
402 posts
Joined: March 2013
Offline
It does work on non-flat meshes. It just shoots a ray down (by default) until it hits the input mesh you provided (or the default one) and then sticks the instanced object on the ray hit point.

I'm not sure what's going on in your screenshot but ideally, you would not have to remove any “houdini components”. You would, I guess, still have to separate the different floors of your dungeon if it is a multi-level dungeon.
User Avatar
Member
7 posts
Joined: May 2015
Offline
quote
houdini components
unquote

If I don't remove houdini instance script they don't stay on the floor.
User Avatar
Member
7 posts
Joined: May 2015
Offline
I just tried this on a terrain, it says
No mesh filter found on input geo object: Terrain
just a warning, anyway it doesn't snap to the terrain when I ‘lift source mesh’
User Avatar
Member
402 posts
Joined: March 2013
Offline
Is this the Unity terrain system? The snapping wont work on the Terrain system because its not a standard mesh. It's some weird hightmap thing that we don't support at the moment. Only plain static meshes (with Mesh Filters, as the warning says) will work.
User Avatar
Member
7 posts
Joined: May 2015
Offline
Without unity terrain you have no weed painting and probably dozens of other things. Looks like just a dungeon thing then, but I might give it a try on this

http://scrawkblog.com/2013/06/04/massive-terrain-in-unity/ [scrawkblog.com]
  • Quick Links