Forum rules - please read before posting.

Call Event on Prefab from an AC Menu Item button

I can't seem to get this to work after struggling with it for a few days so any help is appreciated.

I have a paid asset prefab called ScreenshotManager which takes screenshots in game as long as it's in the hierarchy of each scene and called from an action list with the Object:Call Event action. I selected the prefab as the Object and selected the Capture() coroutine from the dropdown list. I got this to work on a Hotspot that's in my scene but I want to use an AC button on my InGame menu to call the event from an action list. When I do that I get a console error "Coroutine couldn't be started because the game object ScreenshotManager is inactive!" I have to select the Prefab from my Assets-Prefab folder because I can't drag in the ScreenshotManager prefab from my hierarchy, which I suspect is causing the issue. I have such limited grasp of scripting and I just can not figure out how to make this work. Please help!

I've posted a screenshot here:

Comments

  • edited September 2020

    Hm, I don't know that specific asset, but have you tried the "Send message" action? Try set "Message to send" to Custom, drag the ScreenshotManager into "Object to affect" and type Capture into the "Method name".

    Maybe that will work, that's how I call functions in my own scripts ;)

    Maybe try "Send to children too?" if it doesn't work out.

  • Yes!! That worked. I enabled Send To Children and it worked perfectly. Thank you so much for helping so quickly @Riffmaster !

  • You're welcome, glad it worked out :smiley:

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.