Forum rules - please read before posting.

Sprites Unity Complex + Hold Object

Is it possible to somehow use Hold Object with a Sprites Unity Complex character?

If not, what would be a smart way to mimic it?

(I imagine something like an empty gameobject attached to a hand that swaps child objects in and out when holding various objects.)

Comments

  • The Character: Hold object Action only works for 3D characters, but there' a couple of ways to do it for 2D:
    1. Use the Object: Set parent Action to parent the GameObject to the character's Empty child.  If you want to attach to a player prefab that isn't in the scene outside of runtime, move the player into the scene, assign the Empty, apply changes made to the prefab and remove it again - the Empty object should now have a ConstantID component that AC can use to find it again.  You will also need to attach the Remember Transform component to the GameObject that gets held in order to store it's parent in save game files.
    2. Attach the GameObject as a child object of the character, and show/hide/change the sprite via animations, and control those animations in-game using the Character: Animate Action.  This would be the cleaner solution.
  • Thanks, I'll look into both methods.

    2 sounds much easier, but the animations I'm using are already stacking up like crazy. Is there also a way to have swap the spriterenderer's sprite with an inventory item texture based with a custom action?
    (I'm not a very skilled programmer, but am willing to dive into it and learn if you think it's achievable and not a dumb idea)
  • Yes, that sounds possible.  You may have to do some extra work in order to save it (see these tutorials: tut1, tut2) but that'll be the next step - first you just want to get the Actions changing the sprite.  An Action can also be extended to make use of parameters, which is covered in a tutorial here.
  • Thanks for pointing the way.
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.