Portal Setting Sync Y Position does not work

When entering the portal at ground level with the Y sync off the transition is fine.

When entering the portal above ground level, with Y sync off, the player transitions on the new scene at ground level which is not desired.

When entering the portal at any point on the Y axis with “Sync Y Position” on the scene transitions but the player does not spawn near the portal’s expected location or the Y axis position from the previous scene, again not desired.

I am fully prepared to accept I am doing something wrong. But I have followed all the advice from the tutorials and post here and it just isn’t working as expected so I can only conclude it is bugged. If we could perhaps get an updated breakdown of the feature or an alternative that would be great.

Thank you!

I think I know the issue! After some testing I think your PortalCollision transform isn’t zeroed out. The Y sync is reading off the Portal’s transform, not the PortalCollision’s, so if those two don’t line up you’ll get unexpected spawn positions.

If you reset the PortalCollision transform so it’s at 0,0 relative to the Portal. Then when you need to reposition the Portal in the scene, click the lock child button on the Portal node so you don’t accidentally select the collision, and drag from there.

I put together a quick video showing the process:

1 Like

Thanks for the response! Unfortunately I have already been down this road and have adjusted the Portal and Portal Collision a few different ways to get it to work to no avail.

I have noticed a behavior with the portal in relation to the player’s collision box - the players collision box bottom seems to always align with the portal + at the destination. This causes the player to always “drop in” on transition.

Anyway using Sync Y still breaks functionality no matter where the portal + is. The only solution to achieve my desired result so far is to stack multiple player sized portals at both locations so the player enters in the next scene at the relative same height as they left the previous one (i.e. Jumping in to the next scene).

Correct me if I am wrong but isn’t that is what Sync Y Position supposed to do? I may be attempting something a bit out side its intended parameters as I am using a rather tall and thin portal collision. I don’t think that should matter unless the y positioning calculation has limiting parameters that can not be seen in the editor. I really don’t know.

The current solution I have in place will work to my needs so I am good there. I may need to learn more about the functionality of the Portal Node. I watched the video you did on the topic and that got me started but your example was in a top down environment so I got to experiment a bit in mine.

If I did find a bug I am glad I was able to pass it along and if not thanks for the learning opportunity :grin:

EDIT: I forgot to mention that the player animation repeats after the transition rather than continues. Is this intended or is this managed elsewhere?

I did some more testing and found a couple of things that need to be set up correctly for Sync Y to work.

For your player, you’ll want the bottom of the CollisionShape2D to sit at the object’s global position, meaning the bottom edge should line up with the 0,0 horizontal line in the editor. The attached image shows what that looks like. This is what determines where the player lands on arrival.

For the portals themselves:

  1. Make sure the PortalCollision position is set to 0,0 and move the portal object itself to where you want it in the scene.
  2. For Sync Y to work, both portals need to be the same height. If they aren’t, the sync won’t calculate correctly. I’m pretty sure PGM had the same requirement.
  3. If you’re also using Sync X, both portals need to match in width as well.

With those in place, Sync Y should get you the result you’re after.

For the animation repeating on transition, do you have your player set to Keep State After Scene Ends? That seemed to continue the animation instead of reset it when I transitioned.

1 Like

This sorted the issue! Thank you! I was not keeping the collision Y coords at 0. I was manually placing the center + of the collision box at 0. Also thank you for the “keep state” check box. I was at a complete loss with that LOL

1 Like