How do I Move Player to Another Layout Plus keep Variables

Get help using Construct 2

Post » Wed May 11, 2016 2:26 pm

How do I Move Player to Another Layout Plus keep Variables

My code
------------------------------------------------------------------------------------
[E is Down] [System Go to Layout 2]
[When overlapping Object]
------------------------------------------------------------------------------------

It does switch layouts but the player is not shown and the Layout and the Variables reset

Please send a capx file if possible!
B
51
S
33
G
19
Posts: 59
Reputation: 14,294

Post » Wed May 11, 2016 4:41 pm

Hey there,

So I would guess that you're using variables that are specific to the player object itself?

There are two things you can do:

1)Set up an array with all your variables (as it would be global), and then have your player variables populate from the array. This way, no matter which layout your player goes to, it will always maintain it's variables. (Although, if you did this, you might as well just cut the player variables out altogether as it would be an unnecessary intermediary container for the variables)

2) Switch to global variables, as they won't be changing from layout to layout, unless you have a "reset global variables" action set up.
B
60
S
36
G
23
Posts: 341
Reputation: 17,157

Post » Wed May 11, 2016 5:09 pm

supreme676 wrote:Please send a capx file if possible!


Please provide your current project first so we can build on top of it.
Anyway, ultrafop's answer is correct and is the theory on how to go about what you asked.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, marc254, Mayfly, tarek2 and 18 guests