How do I pin the instances? (not whole object) [solved]

Get help using Construct 2

Post » Sat Mar 05, 2016 11:24 pm

https://www.dropbox.com/s/tuw0hmbd0dp9jbh/ShadowPin.capx?dl=0

This is capx, I need a little help, I'm making drop shadows, I couldn't figure out how to assign to pin instances, for some reason I cannot use extra objects to assist due to optimization tips. There no way to access instance control to pin like sprite(0), sprite(1), etc.

Any ideas?
Last edited by Joannesalfa on Mon Mar 07, 2016 6:59 am, edited 1 time in total.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sat Mar 05, 2016 11:26 pm

Events:
Image

Result:
Image
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sun Mar 06, 2016 9:03 pm

@R0j0hound

Sorry for bothering you. But no one could help me how to deal to control the instances.

Would you mind to explain how to do this?
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sun Mar 06, 2016 10:27 pm

If I understand correctly you use the same object for shadow and for the blue cross which shadow should be assigned to?

In the function try to pick instance from the family perspective (not Sprite2).
Then spawn Sprite2 (shadow) and pin it to the Family object (this has to be within the function so the SOL is correct).

So
Code: Select all
On function "crateShadow"
Family1 pick by UID
     Family1 spawn object Sprite2 at image point(x)
     Sprite2 pin to Family1
     other actions if needed
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Post » Mon Mar 07, 2016 1:41 am

@BackendFreak yes and I tested with your snippet, it's not working. You know in C2 it's very hard to access the instances such like Sprite2(index) to pin.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Mon Mar 07, 2016 2:34 am

ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Mon Mar 07, 2016 2:44 am

Maybe I don't understand what you exactly need. I pin with instances all the time. I've created a quick example https://drive.google.com/file/d/0BwT_0l ... sp=sharing
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Post » Mon Mar 07, 2016 6:59 am

@blackhornet
@BackendFreak

That's exactly solution what Im looking, I had frustration since I don't understand how to give action each desired instance. Anyway, thanks for all!
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361


Return to How do I....?

Who is online

Users browsing this forum: NN81, plinkie, TsubaRu and 9 guests