Forum rules - please read before posting.

AR-Mode : Switch 3D GameObjects on and off

Hi everyone, I'm facing a (probably mild) problem which is giving me a headache. It sounds pretty simple. In my little 3D FPS adventure game, the player will find glasses, something like AR glasses. As a result, he sees 3D objects that he would otherwise not see, all with a holographic look.

I thought to myself: Just create "AR_Objects", set them to "disabled" by default and "enable" them via Action Script (A menu button "AR Mode" appears at the top right, which allows the player to switch this view on and off. ) But I can only change the "Visible" value via Action Script and I'm wondering how to set the AR_Objects to "invisble" for the game start.

I wanted to use the animation controller approach, but I'm wondering how I can integrate this approach with a menu button.

Can someone untie the knot in my head?

Comments

  • You can set the default visibility state of an object by attaching AC's "Remember Visibility" component to it. This can also be set to affect child objects, so only one on the root should be necessary.

    Another option, since you have a root object containing the visible objects, is to teleport the root in/out of view using the "Object: Transform" Action. This may be preferable if some of the AR-only objects are interactive, as a Hotspot is still interative even if its mesh is hidden.

    I wanted to use the animation controller approach, but I'm wondering how I can integrate this approach with a menu button.

    The "Object: Animate" Action can be used to control an Animator Controller's playback, by e.g. changing an Animator parameter value. This can be used by a Menu Button's ActionList asset to affect an Animator in the scene, so long as you save the scene afterwards - since it'll record a Constant ID value to bridge the connection between the scene and the asset file.

  • ok, since some of these AR Elements should have hotspots, i will go the "Object:Transform" way. By the way: the "remember visibility" component didn´t work. i have a empty game object (AR Elements) with a couple of test spheres. I added the component to the AR Element + effect children, but on start, the spheres are still visible.

  • I can't recreate such behaviour. What's your AC version, and did you set the component's "Visibility on start" field to "Off"?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.