Instance current position

0 favourites
  • 4 posts
  • Hi, I have a problem how to get a current position of every instance object, because I have more objects of the same type in my level and when I get obj.X, its x co-ordinates of the first created object outside of the layout but not the x position of any object somewhere in the level. Thanks a lot guys ;)

  • Start the condition with a "Pick"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you share the event/actions in question?

    It's probably that you aren't providing the object as the context of the action, and rather you are just referencing the position in the action's instruction (on the right side of the action).

    I'm guessing your action looks something like this:

    System -> YourObject.X [do something]

    This will reference just the first object in the list of instances of YourObject.

    You'll either have to do something like this:

    YourObject -> self.X [do something]

    or

    Event: System -> foreach YourObject

    Action: System -> YourObject.X [do something]

    Good luck!

  • Yes, you're right! Sounds logical and it works! Thanks everyone for help. ;)

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