How do I link two objects together based on Instance Variable?

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi,

    I am creating a survival game, and in it the player has an inventory with a hot bar. When inspecting the inventory, players can move items from their category slots to the hot bar slots. I have two sprites, both are the same in terms of animations and frames. One is for the actual inventory items, the other is used to display the items that are in the hot bar. I am trying to use these events which compare the instance variable of the hot bar item to the inventory item so that if they are the same, the hot bar item will change its animation and frame to match that of the inventory item but it is not working:

    Any tips on how to get this to work?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Where is the picked item condition? I don't see it. Construct need to be informed which sprite is being "on charge".

  • Are there multiple instances of AlmightStuff object? Then you might need to put your events inside of "For Each AlmightStuff" loop.

    When you are using AlmightyStuff.SlotNumber in a condition, then only the first instance of AlmightStuff object is checked.

    There are easier ways to link objects in C3 - containers and hierarchies.

  • Thanks, the "for each" loop worked to get the hot bar showing the items!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)