Snouto

[Solved] Unity GameObject Opacity & Children

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

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.