Compare different instances' instance variables?

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • If I have an object of Car and I have a blue instance and a red instance and I want to compare the cost of each car to the other, is there any easy way to do this?

    I would do it by "Pick instance with UID" which will isolate the red car and then store the Car.Cost into a global variable "tempCost". Then I will have to again "Pick instance with UID" to isolate the blue car and then compare the "tempCost" variable to the Car.Cost.

    Is there a way to more directly compare Car.Blue.Cost to Car.Red.Cost? Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Another method is to actually put the Car into a family (just call it 'FCar' or something)

    and then you can have a condition which picks what Car(s), and another to pick what FCar(s) specifically, even though they are the same object.. it's just a way of differentiating two separate 'pickings' for the same set of actions.. (so you can have one action that only applies to the picked Car, and another action that only applies to the picked FCar)

    This way's a bit confusing though, it sounds like your way would be all that's needed for the task.

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