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
17
S
7
G
1
Posts: 157
Reputation: 1,878

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.
Image
B
64
S
23
G
7
Posts: 1,483
Reputation: 10,827

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
67
S
28
G
24
Posts: 970
Reputation: 18,675

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
17
S
7
G
1
Posts: 157
Reputation: 1,878


Return to How do I....?

Who is online

Users browsing this forum: Allardje, Rudi55, sublimate and 2 guests