Forum rules - please read before posting.

Q regarding sending an object a message

Hi :) I've got an inventory item, it has a Use action that lives somewhere in the Project Resources folder.  That action called a method on an object (useMop).  At first, the object w/ that useMop function was only in one scene, so using the object in another scene caused an error.  

I'm trying to fix that but not sure how.. I put the useMop object in Resources and I changed the action script to call useMop on the object in Project Resources rather than in the hierarchy.  But it's still only working in that scene and not the other scene.  I'm sure this is something fairly simple that I'm overlooking... but how can I send an object a message via an inventory interaction regardless of scene?

Comments

  • This is with the Object: Send message Action?

    When an asset file references a scene object, it does so by recording that scene object's Constant ID number - and creating one if one doesn't exist.

    You can use this fact to have this work in multiple scenes - by giving this object the same Constant ID number across all scenes.  This can be done manually, by copy/pasting the ID number in each scene instance's Inspector, or automatically: make it a prefab, then check "Retain in prefab?".  This will make the number the same across all scenes.
  • Ohh, so it has to be present in every scene?  Got it working thanks to your advice :) Thank you!
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.