-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Added pingpong
built-in function
#46346
Conversation
f5e3ec0
to
9a8abdf
Compare
9a8abdf
to
e54c644
Compare
pingpong
built-in function
What are some practical use cases for this function? It's usually better to use While I'm not against this change, I would advise using methods that result in smooth animations whenever possible. |
@Calinou I have no idea by myself since I'm not using it, maybe some former Unity users may say why they like it and whether they want it in the Godot. |
e54c644
to
6a2e715
Compare
@Chaosus We don't just add features in case maybe someone will use it one day. This needs a proposal. If you aren't using it and don't know how it will be used, that is hardly a substantive use case. So I'm closing this as per the Godot proposal policy (since there is no use case here, one needs to be presented in a proposal before this can be considered).
|
Ok, I forgot about it a bit... |
Please restore this PR, so I need this for #48332! That PR is to implement a ping-pong loop in the animation function, and without this function, it will have to write the same mathematical expression again and again. In short, instead of normal loop using |
@Chaosus is currently unavailable, but we we discussed that if we are able to find a use, we can use it. So we can put |
Yes, it has been merged into my PR, so there is no need to necessarily restore this one unless a step-by-step merge is required. |
For the record, this has been implemented in #53819 |
This math function used in Unity(https://docs.unity3d.com/ScriptReference/Mathf.PingPong.html), Blender, and (perhaps) many other engines. The proposal is to give users the same capability to use it as in them. This implementation is a copy from Blender with just cosmetical changes(should work as a Unity version, except for negative length values(which are not supported in the Unity for this function anyway)). Added to GDScript / C# / VisualScript.