Forum rules - please read before posting.

Check if Pickup Object Has Been Thrown?

edited September 2021 in Technical Q&A

Is there a way to check the current velocity/force applied of a pickup object in an Interaction upon being let go, and then use that as a variable? What I want to do is play a whoosh sound when the object is thrown, but not when it's being set down. Thanks in advance!

Edit: Or alternatively, I could check if the object "isBeingThrown", and I set a custom variable for that in the PickUp C# script, but am unsure how to access it within an ActionList.

Comments

  • Sounds like a good case for the addition of an OnPickUpThrow custom event - I'll look into this.

  • edited October 2021

    I might be missing some things, but how difficult would it be to add custom events myself? If I could it would make AC a lot more powerful for me. Or if I could reference a C# script's variable as an AC variable and then access it in the action editor, that would work also. I like AC's default stuff as a great starting point for getting a game up and running, but it would be good to have further freedom as it progresses.

  • All events are handled by the EventSystem script, if you want to edit/add additional events.

    Linking an AC variable to a C# script variable is already possible, however. A Global or Component variable's Link to field can be set to Custom Script. A script can then be hooked into the OnUploadVariable / OnDownloadVariable events to sync its value with something else.

    See the Manual's "Variable linking" chapter for details, and the included "Variable Linking Example" script for an example.

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.