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

Transform methods look_to and look_at are confusing #8452

Open
nicopap opened this issue Apr 21, 2023 · 1 comment
Open

Transform methods look_to and look_at are confusing #8452

nicopap opened this issue Apr 21, 2023 · 1 comment
Labels
A-Transform Translations, rotations and scales C-Docs An addition or correction to our documentation C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@nicopap
Copy link
Contributor

nicopap commented Apr 21, 2023

How can Bevy's documentation be improved?

What's the difference between "looking at smth" and "looking to smth"?

Difficult to tell… Yet Transform has two distinct methods on Transform called look_to and look_at. One considers the argument a relative position to look toward (a direction), the other considers the argument as an absolute position to look toward (a position).

Code review during #6692 said that look_to could lead to confusion.

Solution

I thought about this a bit, and there isn't a perfect solution.

However, I suggest replacing look_to by look_in. Why? Because it's grammatically incorrect to say "look in enemy", but it's grammatically correct to say "look in direction".

@nicopap nicopap added C-Docs An addition or correction to our documentation C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Transform Translations, rotations and scales labels Apr 21, 2023
@alice-i-cecile
Copy link
Member

look_towards may be clearer and more grammatical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Transform Translations, rotations and scales C-Docs An addition or correction to our documentation C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

No branches or pull requests

2 participants