Forum rules - please read before posting.

Remove Object Shadow After Pick

Dear Chris and AC followers,
I've an issue when picking an object from ground, related to its shadow.
My game is 2.5D, 2D backgrounds, 3D characters and items.
I've a 3D item on the ground, that has a "Blob Shadow Projector" (it was for me the best way to achieve its shadow), the one that comes with Unity Standard Assets, in this video an example of it.
The problem is: when I pick an object, I cannot get rid of the shadow.
I've a parent object that contains Hotspot parameters and Visibility (both with Remember Visibility and Remember Hotspot), so when I pick the item, I've set to disable Hotspost, and render invisible the Object (affecting children). Now, despite the Blob Shadow Projector is a child of my object, it stays visible (3D mesh disappears correclty, Hotspot is disabled correctly, Blob Shadow stays there).
To make a summary: parent object contains hotspost and visibility, children are the 3D mesh and the BlobShadow. All works great, but the shadow stays there...
Why is this happening? Is the only solution to teleport it out of screen and add a Remember Transform?
Thanks

Comments

  • The Object: Visibility Action and Remember Visibility component work by manipulating a mesh renderer - not any other component that may be attached as well.

    You could teleport the whole object out there, and save its position with a Remember Transform component instead, but that's not the only solution. Two others:

    1) Control the object's visibility, and enabled state of the Blob Shadow Projector component, through animation, and use the Remember Animator component to save that animation state.
    2) Attach a simple script that syncs the Blob Shadow Projector's enabled state with the visiblity state of the MeshRenderer:

    using UnityEngine;
    using AC;
    
    public class SyncProjector : MonoBehaviour
    {
    
        Renderer _renderer;
        Projector projector;
    
        void Start ()
        {
            _renderer = GetComponent <Renderer>();
            projector = GetComponent <Projector>();
        }
    
        void Update ()
        {
            projector.enabled = _renderer.enabled;
        }
    
    }
    
  • Awesome as always! Thanks a lot!

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.