Forum rules - please read before posting.

Editing action list via script?

edited April 8 in Technical Q&A

Hello all,
Has anyone managed to successfully change an asset lists properties through script? By this I mostly mean parameters and variables. Its readable so I tried to change a gameobject parameter once by changing the constant id but for some reason it always kept the old parameter no matter what (restarting unity, deleting meta file, even duplicating it lol)

It's just because I tend to have big actionlists and then realise I need to duplicate it with different parameters, finding and replacing in script would be much faster than replacing each action parameter manually so I wanted to see if it's possible. No worries if not :)

Comments

  • edited April 9

    Modifying an ActionList through is possible, though asset files should only be modified while in Edit mode.

    Details on working with Actions through script can be found in the Manual's "Generating ActionLists through script" chapter.

    However, if it's a case of running a given ActionList with altered field values, it's best to use the Parameters feature - these act as Variables that can be assigned to various fields throughout your ActionList, and can be set at runtime using the ActionList: Run or ActionList: Set parameter Action. A tutorial on their usage can be found here.

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.