Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look_at not starting from the Node rotation #19003

Open
ghost opened this issue May 18, 2018 · 2 comments
Open

Look_at not starting from the Node rotation #19003

ghost opened this issue May 18, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented May 18, 2018

Godot version:
Godot 3

Issue description:
Look_at function should be start from the Node rotation .. not from 0 or 90
it should be smooth rotation

download the project and see
press the Arrow the move the Target , press Space bar to start looking at the target
it must start from the node rotation to be smooth rotation .. not from 0 or 90 degree

Minimal reproduction project:
Look_at.zip

@kubecz3k
Copy link
Contributor

kubecz3k commented Jun 3, 2018

Not sure if I understand the issue correctly, but look_at works in global coord system, so you need to use global positions. If you have direction then you need to do something like look_at(global_transform.origin + lookDir)

@Calinou
Copy link
Member

Calinou commented Apr 27, 2020

I think OP wanted to have an "offset" for the node rotation applied after look_at(). Isn't this a matter of just calling look_at() then adding the angle you need to the rotation property every frame?

Otherwise, you could use a parent-child structure for this where you'd use look_at() on the parent node and rotate the child node independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants