How do I move a container with it's "children"?

Get help using Construct 2

Post » Thu Nov 13, 2014 6:23 pm

Hey all

Suppose I have a big square sprite, and a smaller one "inside" it, and they are both inside a container.
When I move the big sprite, the smaller one doesn't move with him...

Isn't this the purpose of a container? (aside from instantiating multiple sprites in a container)
B
18
S
7
G
1
Posts: 157
Reputation: 1,928

Post » Thu Nov 13, 2014 7:06 pm

https://www.scirra.com/manual/150/containers

What containers do

Placing objects in a container has the following effects:

1.If one object in a container is created, every other object in its container is also automatically created.

2.If one object in a container is destroyed, every other associated object in its container is also destroyed.

3.If a condition picks one object in a container, every other associated object in its container is also picked.
B
66
S
24
G
7
Posts: 1,515
Reputation: 11,041

Post » Thu Nov 13, 2014 7:10 pm

A pin behavior will make them move together, bundling them in a container won't. But you can do both, no problem ! ;)
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Thu Nov 13, 2014 7:55 pm

Ah pin did the trick (although some small shakes, I reckon it's due to some rounding issue of the JS engine) :)

Thanks a lot! and you too, @korbaach, for refining it for me :)
B
18
S
7
G
1
Posts: 157
Reputation: 1,928


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev and 22 guests