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: 161
Reputation: 1,941

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
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

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
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

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: 161
Reputation: 1,941


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 62 guests