Forum rules - please read before posting.

Prefab setup still seems.. almost useless.

My setup as follows:
Prefab game object in project directory.
Hotspot component on this prefab.
Asset based action list in project directory as well. The hotspot uses this as it's interaction.
In that action list, an Object Visibility action which should hide instances of this prefab and a Hotspot: Enable or Disable to disable their hotspots.

If a person wants to set something like this up so he can drag and drop them into the scene and just have them work, how is it done? My feeling right now is the way AC structures things basically cuts the legs out from unity's prefab mechanism... but I'm hoping I'm misunderstanding how it's used.

Comments

  • Your example case should be perfectly do-able.  Let's see some screenshots of the Hotspot and ActionList inspectors.

    You must first ensure that the ActionList features a GameObject parameter, and that this is used to override the appropriate fields in your Actions.  For example, the Hotspot: Enable or disable Action's Hotspot to affect field.

    You must then have your Hotspot set this value dynamically by assigning it in the Hotspot parameter field that appears beneath the Interaction field.  If you wish to assign other parameter values at this time (without need for an interim ActionList: Run Action), that can be done with the aid of a simple custom script.

    In order to differentiate between multiple instances of the Hotspot prefab in a scene, it must have a Constant ID number.  You should then find that each time you lay down a new instance of the prefab, it is assigned a unique ID number (as reported by the Console window).

    Clicking on the Hotspot to trigger its Interactions should then assign the appropriate Hotspot to the parameter.

    In order to have such changes made to your scene be save-able at runtime, you'll need the appropriate Remember Component.  As I described in your other post, there is currently an issue when it comes to the auto-setting of IDs when multiple such components are present, but this'll be fixed in the next release.

    Here's an example package demonstrating how a prefab can be either hidden or removed from the scene:


    To use it, double-click the ManagerPackage file within to auto-assign the Managers, and load up either of the two included scenes.
  • To clarify: in this instance, Constant ID numbers / Remember components are only necessary if you want such changes to be recorded when managing save game files.  If you're purely looking to have the Hotspot set correctly, you can remove all such components (try it with the example package).

    If you do require CIDs, they must be unique for each object.
  • Hey Chris, I've come to see the Hotspot Parameter works how I needed, it just wasn't very intuitive to me personally.  I appreciate you going into detail about all of this, as I think I've come to understand how the things you've described now.

    I appreciate you taking the time. Cheers.
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.