Jump to content

[Solved] Unity GameObject Opacity & Children


Snouto
 Share

Recommended Posts

Hi

New to babylon.js and I'm trying to set an visibility value to a mesh in my scene, such that I can animate the visibility to zero. The scene has been exported from Unity in to Babylon. The object in question is actually a typical Unity GameObject, whose child GameObjects all have Mesh Renderers and materials attached. So the main parent GameObject has nothing other than its inherent transform, and therein lies the problem: when in Babylon, this object has visibility:0 and no material object (in other words, it resembles the GO in Unity). What's kinda interesting/strange (to me) is that the parent GO in Babylon has visibility:0 already, yet I can see the child objects no problem. Thus changing the value of visibility of the parent GO in Babylon has no effect on the visibility of its children.

I suspect this is more to do with Unity than Babylon, however. In Unity I have a similar problem if I try to animate the opacity of one of the GO's children. I think it comes down to the shader being used for the material - the one I have at the moment (Mobile/Diffuse) does not appear to present a parameter for colour and opacity, thus opacity can not be adjusted not even in Unity.

For my own understanding, however, is there a way I can easily change the visibility/alpha/opacity of the parent object in Babylon that will also affect the child objects, or would I have to iterate through every child and animate their visibility values individually? Or is it really the case that I need to change how my Unity scene is constructed before Babylon an help at all?

A visual of the object structure in Unity is here.


Cheers

Link to comment
Share on other sites

  • Snouto changed the title to [Solved] Unity GameObject Opacity & Children

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...