Forum rules - please read before posting.

Using script to assign a gameobject to AC cutscene?

Hi,
So I tend to have a lot of cutscenes with ALOT of gameobject fields, that all have attached to them the same 1 gameobject, and I was thinking of making it more efficient by making a script to automatically set a cutscene's gameobject field with the gameobject (obviously you cant set more than 1 without making it more complicated). So essentially if a cutscene has 5 set parameter actions with the gameobject fields, then the script would assign the one you attached to all 5 of those gameobject fields.

I tried looking through the AC scripts that have the action UI for setting a gameobject inside an action, but I'm not sure which ones are related and whether they would be usable for a script or if it's something entirely different?

Thanks!

Comments

  • Sorry, you're going to have to break things down with more detail and/or screenshots. You're referring to GameObject fields in Actions, or GameObject parameters used to set those field values?

    You can set an ActionList's parameter values through script, by referencing that parameter's ID number:

    myActionList.GetParameter (0).SetValue (myGameObject);
    

    This is the recommended way of setting Action field values through script, since trying to modify Action fields directly would be too complex.

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.