0 votes

I'm currently trying to make my camera look at a specific entity when a player presses a key, sort of like a lock on system. My game is a top down game, so I want to keep my player at the bottom of the screen while the entity which is being lock onto remains above the player. However, because of how Camera2D is coded, the front of the camera is actually on the right-side of the screen. thus lookat() doesn't do exactly what I want to do. to work around this, I simply need to make my camera lookat() a new var, lets call this cam look, which is the entity's position, rotated 90 degrees around the center of the camera. However, I cant seem to find anything online that shows me how to do a fixed rotation around a vector and not a point (meaning the var being looked at everyframe is the 90 degree rotation around a vector2D of the updated position of the entity).

Any help would be much appreciated.

in Engine by (14 points)
edited by

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 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.