Help Needed: Actor Instances and Attributes

EatingMyHatEatingMyHat Member Posts: 1,246
edited November -1 in Working with GS (Mac)
Hi All,

I am fairly new to GameSalad, soI might be doing something wrong...

I created an Actor with a new attribute called 'InstanceID', I also have a Game attribute called 'PressedID'.

I than placed 3 instances of this actor in the scene and for each one changed the InstanceID to be 1, 2 or 3. I also added a Display Text for this attribute at the Prototype.

The logic is simple, if the instance is pressed it should change Game.PressedID to be self.InstanceID.

However, while Display Text shows the correct values of the attribute (different values for each), every time I press one of them the Game attributes gets the same InstanceID (which is always the last Instance that I added...).

Am I misunderstanding or misusing something? Is there a better way to do it?

Thanks,
GR

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    In the 1st actor do if touch is pressed change attribute game.PressedID to 1 then a rule if game.PressedID = 1 display text.

    2nd actor do if touch is pressed change attribute game.PressedID to 2 and so on

    Darren.
  • EatingMyHatEatingMyHat Member Posts: 1,246
    Thanks Darren,

    I know how to do it with two actors using specific rules or with two instances while breaking the prototype lock. However, I tried to do with two instances of the same one and have a common rule without changing the prototype rules and keep 1 and 2 as attribute values.

    Whats strange is that while DisplayText shows the unique attribute value of each instance, when I assign the value (from the attribute) to the Game attribute, it only gets the last one...

    Thanks,
    GR
Sign In or Register to comment.