-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Document simplest way to turn 3D node towards an axis with interpolation #4478
Comments
It's already simple enough. You can use the What you propose is too specific to end up into the core. |
Or basically follow the comments there godotengine/godot#21383. |
As your link, this new function is to avoid all those code lines. About look_at, you can' t restrict two axis. Godot needs some high levels functions for very common things, like those Unity has. |
Yes you can, you simply have to change the look target. By basically putting your target as the same coordinates on the axis you want to restrict.
No, that's not Godot philosophy. It might be a common thing, but there are a lot of ways to handle such movement. That's why such proposal is mostly pointless as too specific. The look_at and interpolate_with functions ease the work enough. |
Same coordinates as target is some good idea, unfortunately there was no examples on documentation to show different ways to use it :( I don't understand, how can you rotate with lerp some object to another using look_at ? Why not combininig the two in some look_at_lerp() ? |
Here we are, three lines of code :
Because there is not more reason for that than implementing color_lerp() or anything_lerp(). We have generic functions for that, adding specific function for each case is just bloat into the API. |
That's a good explanation. Could those be in the docs ?
|
I agree that this should go in the docs as it's often requested, and though it's relatively simple as shown by @groud, it's not always trivial to come up with from scratch. @godotengine/documentation any advice on where to put it? |
Yes, it's one of the most used and requested features for 3D games. |
Thanks, it worked.
Look At on Y axis is the most used , it could be added to the manual. |
@akien-mga I have 2 places in docs to propose:
|
The example would feet very well in "3D transform" |
Closing as there's been no activity for some time and as per #3390, tutorials are being moved out of core docs. Here's one that covers this: http://kidscancode.org/godot_recipes/3d/rotate_interpolate/ Feel free to open a new issue if you feel the need is still there. |
Instead of coding many lines of code each time,
a high level simplified function to rotate an object to face another object position.
TurnTo ( Vector3 position, Vector 3 axisTurn, bool direct, float speed, bool lerping)
Vector3 position: object to turn to
Vector 3 axisTurn : axis rotation to use
bool direct : turn directly , don' t use speed
float speed : rotation speed for turn
bool lerping : should use lerping when it uses speed
The text was updated successfully, but these errors were encountered: