-
Notifications
You must be signed in to change notification settings - Fork 1.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
ThreeJS Object3D flickers when tweening with yoyo turned on. #681
Comments
VID_20240221_211342.mp4 |
Thanks for your feedback, this is a known issue. #677 |
Hey @NyaNguyen - is that a cell phone video of a monitor displaying that demo for the flicker - or is that the actual canvas output? It has a cool postprocessing effect :) |
heh....umm..yeah, it's a cell phone filming the monitor with an overhead light shining on it. The flicker we see if what is actually rendered on the screen. ;D |
Until we can fix this, a workaround is to create two tweens, one going in the opposite direction, and chain them. If you intend to only make it bounce back and forth linearly, another option is to simply increment on each frame like this (instead of using Tween.js): let pos = 0
let direction = 1
function animate(time) {
if (pos <= 0) direction = 1
if (pos >= 1) direction = -1
pos += direction * 5
} Where you can replace |
Oh no, a bandage solution! :P Hey, I decided to take a look at the code. Isn't the fix for this simply to move the following code at the bottom before the
Seems to work... |
If it works and all tests pass, let's do it! Would you like to open a pull request? |
There's two issues with that fix:
|
Fixed in Released in v23.1.2 |
ok, so I tested this and was able to reproduce the issue with this example:
We can see the Object3D flickers each time it bounces back and forth. I'm not too sure if this is a TweenJS bug or there is something I need to do in ThreeJS to ensure the position does not somehow reset.
I attached a quick video of the problem. Tested with Firefox and Edge and got the same issue.
The text was updated successfully, but these errors were encountered: