Forum rules - please read before posting.

Prefab with built in Animation and Action Lists

Hello! I'm new here but truly enjoying Adventure Creator. I'm just starting on my game development journey but it's a fantastic tool

I encountered an issue but i don't think i'd have it if i was coding it, but in the AC logic when i have a prefab with a specific ActionList on it, any instance of that prefab will always point back to the original instance of object.

The example i'm doing is a door. It's openable but when add and use any additional instances of the door it only triggers the original instance because the variable check and the animation triggers are all pointing to the original instance. I'd love to know if there is a work around for this (or maybe i'm doing it wrong?) as i'd like to use prefabs in the game for these type of interactive objects with embedded animations.

Comments

  • edited February 4

    Welcome to the community, @Mobius509.

    You can achieve this by dynamically altering the Action fields at runtime, setting them to the specific instance of each prefab.

    The key steps are:

    1. Create a parameter in the ActionList and use it to override the intended field (e.g. a GameObject parameter to override the object affected in the Object: Animate Action).
    2. To your Hotspot, attach the Set Interaction Parameters component
    3. Configure this component to have it set this parameter to the scene instance of the prefab you wish to affect

    It sounds a bit complicated when explained like this, but it makes more sense when you see it. A tutorial video covering this in much more depth can be found here.

    If you want to make a go of it and come across any trouble, share some screenshots here and I'll try to spot what's what.

  • Oh excellent that there is a tutorial. Just watched and it's exactly what i needed. Appreciate it Chris!

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.