The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

Here's my code on GitHub.

I'm trying to get the Zelda/Megaman/Celeste-style sliding room transitions going. I've borrowed heavily from this Megaman project as well as from AUDFORIUV's posts on reddit (although I'm not using his style of room transition). I know there are a million ways one could go about this, but, sticking with what I have - why is it going wrong?

Specifically, my camera tween snaps to the player's location before completing the motion. At a transition speed of 0.1 (export var, can be played with in the editor) it goes fast enough that you can't tell, but at 1, 2, 3 seconds it's very noticeable. The tween is attempting to move each camera limit to the next room (hard-coded for the time being) as well as the camera's own position. In testing, this behavior happens whether I comment out the camera.position tween or not, which is extra confusing. I also have a player movement tween that's supposed to run and move the player to the right, but it's not working. I've tried turning off the player's physics, the camera's process that follows the player, changing the collision on the Area2D, changing TRANS_LINEAR to every other interpolation, using all different global and local coordinates, changing the order of nodes and the order of interpolations, making my own viewports, and many other things... I'm just about at wit's end.

My code's short and hopefully easy to parse. Just a player, camera, control node for views, and an area2d. If anyone can help me figure out what's up I would very much appreciate it. Please let me know if you need any additional information.

in Engine by (19 points)

2 Answers

0 votes
Best answer

I've answered my own question through further experimentation. The main problem was that I was using float position values for the Player and Camera positions, which should have been a Vector2. The rest is just messing around with the transition values. The working code is up on GitHub for anyone who needs help.

by (19 points)
0 votes

Something I discovered is that I had to call tween.stop_all() at the start of the new tween, because if your player is moving it has to stop the current tween midway to do the next one (assuming I understand your goal correctly). Can you show your code?

by (27 points)

The entire project was on GitHub, but I've actually updated it with the working solution in case anyone - as frustrated as I was - comes along looking for help. The main problem was that I was using float position values for the Player and Camera positions, which should have been a Vector2. Thanks for the response anywho. And you're not wrong - one of the projects I was inspired by used tween.stop_all() at the beginning as well.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.