"Set pos to another object" & multiple instances of object

Just started using Construct 2? Post your questions here

Post » Sun Mar 26, 2017 1:16 am

Message: purefabulousity can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
How can i make one instances of one object go to only instance of another object?

Currently my code is: http://imgur.com /x4PpVgP

My plan is to get the position of the Square object and compare it to the SqMarker object, snapping it into place withing a certain distance from the image point of the SqMarker object. However, I can only do this with the first instance of the SqMarker object. If I destroy the SqMarker object, all instances are destroyed.

I would trying doing this by selecting the object's UID or hard-coding it to snap to a certain position, but I plan on randomly generating different levels (that would have a set configuration). I am also limited to the free version of construct 2.

I'll upload my .capx file as well. It's right here: https://www.dropbox.com/s/b1dhtf3ujkq6okm/ Shape.capx?dl=0
B
4
S
1
Posts: 4
Reputation: 310

Post » Sun Mar 26, 2017 1:18 am

Had to put spaces there because the forum modified my URL, sorry.
B
4
S
1
Posts: 4
Reputation: 310

Post » Sun Mar 26, 2017 4:04 pm

B
33
S
18
G
28
Posts: 2,455
Reputation: 20,874

Post » Sun Mar 26, 2017 6:09 pm

Ah, so Line of Sight with a range of 10 will do that? Thank you, I had only thought about using a pin behavior on collision. The more you know. :)
B
4
S
1
Posts: 4
Reputation: 310

Post » Sun Mar 26, 2017 9:55 pm

Yes. But. More important.
Do you see how using instances makes your events compact and clear ?
B
33
S
18
G
28
Posts: 2,455
Reputation: 20,874

Post » Sun Mar 26, 2017 11:57 pm

Yes. It looks like you used animation frames, so they were all in one instance, when I had been using different objects. Way simpler than the code I had made!

Now I'm trying to figure out how to spawn these instances (I have 3 levels, and each level has a few configurations of shapes). Thank you for your help! If all else fails, I can just make a layout for each level, but that's very unwieldy.

Edit: Solution most likely found, I'll update when I'm sure :)
B
4
S
1
Posts: 4
Reputation: 310


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests