Open CarpenterBlue opened 1 year ago
Isn't the implementation you propose dependent on framerate, since it sets a new random position every frame? We should avoid situations where an animation looks different depending on framerate.
I have no idea, I have simple non-resource extensive 2D game so it never really comes into play. Either way, I honestly don't really care with wiggle but if you have better solution I would love to hear it.
This isn't descriptive enough, I don't really get what you want. "Wiggling a property" is quite abstract, do you expect something like the text shake event in RichTextLabel? If that is the case, then I agree with having some kind of similar built-in solution for common basic animations that act on an object's transform. I don't think Tween is the place for it, but I can't really think of a better solution myself.
Isn't the implementation you propose dependent on framerate, since it sets a new random position every frame? We should avoid situations where an animation looks different depending on framerate.
To add to my previous comment: to avoid this effect, noise is typically used as its effective "speed" won't vary based on framerate.
An alternative is to pick a random value a fixed amount of times per second (e.g. 10 Hz) and smoothly interpolate between those values over time.
Describe the project you are working on
Boss fight with Scorpion enemy, I need to wiggle the claws for a bit so I can telegraph launching them towards the Player. Would also use it during cutscenes if I had the chance.
Describe the problem or limitation you are having in your project
I have to make a wiggle function every time I have to do that or make a autoload with the function. Something so common could fit with the tweens.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The current way of doing it is not readily apparent or available and still somewhat clunky
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The node's property will be wiggled for the duration
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, here is my solution for the attack.
Is there a reason why this should be core and not an add-on in the asset library?
It's quality of life feature that can be used in various circumstances. Camera shake Telegraphing Cutscenes Randomizing values for gameplay logic driven by tweens