Forum rules - please read before posting.

Action list parameters and prefab objects

I'm trying to prefab an object and make it as easy as possible to duplicate its functionality without having to update a ton of references every time I place a new one into my scene. When using an action list asset, I understand how to use action list parameters to fill in component variables. But my action list also calls upon things like the animator, the audio source, and the hotspot. Is there a way to automatically assign these as well to a new instance of the object, or do I have to update these references each time I make a copy?

Comments

  • The cleanest way is to attach a Cutscene component to your prefab (which also contains the Animator / AudioSource etc), and set its Actions source to Asset File, and have it reference the ActionList asset file. The Cutscene essentially then becomes an instance of that asset within the prefab.

    What you can then do is further attach the ActionList starter component, which will allow you to set the parameter values for that instance of the ActionList - and these will be retained as part of the prefab.

    The Logic Prefabs tutorial video covers this technique, but you're welcome to share images of your setup for more sepcific advice.

  • Thanks! I love your video tutorials. I don't know how I overlooked this.

  • edited January 2023

    Before continuing to work with my own prefab, I decided to follow along with your tutorial. I have reproduced your proximity light with ease and it works correctly as a prefab however I have noticed that every time I walk in or out of the trigger I get the following warning:

    No AC.Shapeable component attached to proximity light (UnityEngine.GameObject)!
    (From Action #0 in ActionList 'trigger')

    As I said, everything works fine. Is this anything I should be concerned about?

  • Likely not, but I'd need a couple more details to be sure.

    Could you share the warning message in full, as it appears when selected in the Console, as well as screenshots of the Trigger's Actions?

  • Hi Chris, Sorry for the slow reply. I was away from this project for a bit. I've actually just gone through the proximity light tutorial again on a totally different Unity project and I've gotten the same error. The light prefab works fine but I get many instances of this warning in the console:

    No AC.Shapeable component attached to proximity light (UnityEngine.GameObject)!
    (From Action #0 in ActionList 'trigger')

    -> AC debug logger
    UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
    AC.ACDebug:LogWarning (object,AC.ActionList,AC.Action,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:74)
    AC.Action:LogWarning (string,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/ActionList/Action.cs:1333)
    AC.Action:AssignFile<AC.Shapeable> (System.Collections.Generic.List1<AC.ActionParameter>,int,int,AC.Shapeable,bool) (at Assets/AdventureCreator/Scripts/ActionList/Action.cs:1790) AC.AnimEngine_Mecanim:ActionAnimAssignValues (AC.ActionAnim,System.Collections.Generic.List1<AC.ActionParameter>) (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_Mecanim.cs:686)
    AC.ActionAnim:AssignValues (System.Collections.Generic.List`1<AC.ActionParameter>) (at Assets/AdventureCreator/Scripts/Actions/ActionAnim.cs:93)
    AC.ActionList/d__45:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:435)
    UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
    AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:410)
    AC.ActionList:BeginActionList (int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:377)
    AC.ActionList:Interact (int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:278)
    AC.ActionList:Interact () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:241)
    AC.AC_Trigger:Interact (UnityEngine.GameObject) (at Assets/AdventureCreator/Scripts/Logic/AC_Trigger.cs:331)
    AC.AC_Trigger:OnTriggerExit (UnityEngine.Collider) (at Assets/AdventureCreator/Scripts/Logic/AC_Trigger.cs:142)

    https://ibb.co/J7ZVkLR
    https://ibb.co/CQJKY0v

  • Sorry, here are some direct image links which are easier to see.

    https://i.ibb.co/LtKmpwz/proxlight1.png

    https://i.ibb.co/fH8dy0t/proxlight2.png

  • Great, thanks for the details.

    It's a bug, but not something to pay mind to. I'll see the warning is removed, but you can ignore it in the meantime.

  • Thanks for looking into it. I'm seeing the same warning on my custom logic prefab. I'll ignore it for now then.

  • I've also been getting this error intermittently. I have been ignoring it for a while but I am seeing it more often now. I haven't noticed any ill effects but it is a little concerning since it is a red error:

    Resolve of invalid GC handle. The handle is from a previous domain. The resolve operation is skipped.
    UnityEngine.GUILayout:Window (int,UnityEngine.Rect,UnityEngine.GUI/WindowFunction,string,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[])
    AC.ActionListEditorWindow:NodesGUI (bool,UnityEngine.Event) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1606)
    AC.ActionListEditorWindow:OnGUI () (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:216)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    Looking at the log, it does seem to be AC related. Any ideas?

  • I've encountered this myself. It's appearing via the ActionList Editor window, but the issue itself is coming from Unity - so far as I understand it.

    This too, however, is safe to ignore.

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.