Instance current position

Get help using Construct 2

Post » Wed May 22, 2013 5:08 pm

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 ;)
B
6
Posts: 16
Reputation: 307

Post » Wed May 22, 2013 5:52 pm

Start the condition with a "Pick"
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Wed May 22, 2013 6:29 pm

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!
B
8
S
1
Posts: 49
Reputation: 615

Post » Wed May 22, 2013 6:51 pm

Yes, you're right! Sounds logical and it works! Thanks everyone for help. ;)
B
6
Posts: 16
Reputation: 307


Return to How do I....?

Who is online

Users browsing this forum: Zebbi and 23 guests