Forum rules - please read before posting.

Using objects on the player character

Is there a way to set up a hotspot and box collider on the player character so that I can use inventory objects on him?

Comments

  • Yes - is your character 2D or 3D?  If 2D, you'll want to place these components on the sprite child, so that it is always correctly facing the camera.  Otherwise, they can go on the root.

    You'll need to change the Hotspot's Actions source field to Asset File, so that you can call ActionList assets when interactions are run - so that it will work in any scene.
  • Hi Chris,

    I'm using a 2D character and put them on the child.  I also did as you suggested with the Actions source.  The problem is that the character isn't highlighting.  I have just noticed that when I run a scene a little message appears that says that the hotspot state is off.

    Cheers,
    Steve
  • How would this be done on a 3d, keyboard & mouse direct-controlled character?
  • @Deckard_89: Does your game involve a keyboard-controlled cursor?  If it's all done without a cursor, you'll probably want to just create interactions within the Inventory items themselves, rather than "using" them on the player.

    @Steve_Ince: Did you add a Highlight component to the sprite, and assign it in the Hotspot component?  The Hotspot will be off if it is placed on the Ignore Raycast layer - so move it to Default to turn it on.  If you have more issues, please post screenshots so that we can see what's going on.
  • Thanks, Chris.  It was the layer not being set to Default that was the problem.  Works perfectly now.  :)
  • @ChrisIceBox: Yeah, there is no cursor in my setup. We could do with an inventory option where we can have a hotspot within the inventory. For example, we could supply an image of the character (this is the hotspot) that you can use/combine inventory items on, which would then use an Action-list asset that determines what happens whenever you use inventory items on the character (such as firing a custom script, or whatever you want really). I'm not sure how many people are looking for such functionality, but it would certainly help me out.

    :)
  • Certainly seems a bit unique to your game, but I'd suggest having such an "avatar" as an inventory item that's placed in a separate InventoryBox element.

    With inventory categories, you can mark up this "avatar" item in a special category just for that, and then amend your inventory boxes so that the normal inventory doesn't show it, while the avatar's InventoryBox shows only that category.  You could then create "use item on Player" functionality with simple combine interactions.
  • Interesting workaround. Would I be able to prevent the "avatar" item from being placed in a container?

  • Containers can be limited by category as well.
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.