0 votes

When you are hooked to a pole i want the camera to move left and right, but when you aren't hooked to a pole i don't want the camera to move left. What hooked means isn't really important, but what you need to understand is when you're not hooked you can only go in one direction. So i figured since you can only go in one direction and i want the camera to not move left when you're not hooked, i would just reset the limit whenever you become unhooked. Here is what i did:

if $Camera.limit_left < position.x + $Camera.offset.x:
            $Camera.limit_left = position.x + $Camera.offset.x

The camera follows the player with an offset of -330 pixels (which is why i add), and doesn't move up or down. The problem is that for some weird reason the camera seems to jump a little bit when i reset it and i don't know why. Can anyone help? There isn't any smoothing or anything.

in Engine by (243 points)

Please log in or register to answer this question.

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 webmaster@godotengine.org with your username.