How do I synchronize layer position

Get help using Construct 2

Post » Sat Jan 09, 2016 9:17 pm

Message: yosi1202 is not yet permitted to post plain text URLS (300 rep required). 2 URLS removed. Why?
I am having my player moving between 2 layers with parallax, the problem is that when my player moving to the other layer
he does't stay in the same place, that is because the x = 100 on layer 1 and x = 100 on layer 2 are not is the same place
that is ok and is because of the parallax, but how can I move my player to layer 2 and keep it in the same visual place?

images of the problem:thanks in advance
Posts: 1
Reputation: 179

Post » Tue Jan 12, 2016 9:37 pm

You should be able to use the LayerScale's for each layer to transform his position into the absolute reference frame before transforming it into his new layer's reference frame.

I am not 100% how this math would go, but something like:

NewPlayer.X = Player.X / LayerScale("Layer 1") * LayerScale("Layer 2")
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
Posts: 1,365
Reputation: 4,724

Return to How do I....?

Who is online

Users browsing this forum: wertt22 and 7 guests