How do I keep an object's position across layouts?

Get help using Construct 2

Post » Sat May 27, 2017 12:36 am

I'm trying to create a game in which the player can place different objects onto the layout to create a custom vehicle, and I need this custom vehicle to transfer to the game layout, so the player can use it. I have tried to use the Persist behavior, but it only seems to work with object states, not position. Would I need to save each object's position to an array, or can I use local storage/dictionary? Am I using the Persist behavior wrong?
B
5
Posts: 4
Reputation: 233

Post » Sat May 27, 2017 5:32 am

Persist is so the object stays the same when you go to another layout and come back later. You probably want to make the objects global so they don't get destroyed when the layout changes.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Mon May 29, 2017 9:03 pm

The game layout contains the objects that I've set to global. They snap to the position that is set in the layout editor when I visit this layout. Is there any way to snap them to the position they are left in in the build layout?
B
5
Posts: 4
Reputation: 233


Return to How do I....?

Who is online

Users browsing this forum: tunepunk and 13 guests