-
Notifications
You must be signed in to change notification settings - Fork 66
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
Improve capabilities of modifying Tweenables after creation #83
Comments
It occurred to me that this could also enable faster prototyping with the |
Yes,
Note that as explained somewhere else, you can create your own I'm open to suggestions of how this can be improved, but remembering the complication of the trait object, which I think is the main blocker here. |
Btw, I should say thanks for putting together
I was afraid that was the case but am not quite there with my understanding of Traits to have arrived at that conclusion myself.
I could see how that introduces unnecessary trouble. (What if the I have yet to try your suggestion of using The main thing that made me feel like doing something suboptimal/non intended, was to instantiate the That In practice this could look like this: Animator::new(Dummy::<Transform>::new()) I have put together a hack implementation that makes I think this could work out quite well as it doesn't affect other systems but makes the API more capable of expressing this particular intent. This would be preferable over a convenience function too, as it sticks to the existing API patterns. As most of the time we wouldn't want to replace a running What do you think? |
I also put together a small example that could be used to demonstrate this. (Although here I am not using the proposed https://github.com/ivenw/bevy_tweening/blob/main/examples/squash_stretch_jump.rs |
I have implemented a drag and drop system for
Sprite
and would like to build on this by having sprite ease back towards its original position after being dropped.Here I came across some limitations of
bevy_tweening
.For this I query
Animator<Transform>
in a system that checks for theSprite
position and whether it has been dropped. Today, there seems to be no way to update theTransformationPositionLens
of theTween
of thatAnimator
with a new start value, or change other fields of theTween
(as they are private).The only way to get this working that I found is to use the
set_tweenable
method on theAnimator
to set a newTween
. I am not sure about performance impact, but it seems not an ideal way to do things. This also means that theTween
originally defined for thisAnimator
is just unused boilerplate.I would like to define an initial
Tween
and then change some of its parameters in a system call, without having to instantiate a newTween
.I don’t know if this is in the scope of this crate or if there are technical reasons this is not possible, but this seems like an area where improved ergonomics would make
bevy_tweening
even more useful.The text was updated successfully, but these errors were encountered: