About _currentFlyToTime in CesiumFlyToController

Hi, I’m using CesiumFlyToController and I’ve found a problem with it!

When I call flyto, I interrupt the animation, and when I execute flyto again, I find that the screen “flashes”. The screen will fly from an uncontrollable position to the end of the animation.

After reviewing the script, I think it is because the InterruptFlight() function does not initialize _currentFlyToTime to zero. I don’t know what you think about this.

Looking forward to your reply!

Hi @xiameishicang, I agree, that looks to be the problem. Thanks for reporting it. I wrote an issue to cover it:

We’d welcome a pull request to fix this if you’re up for it!

I simply added

_currentFlyToTime = 0.0;

within the InterruptFlight() function in the CesiumFlyToController.cs script.

It works for me, hopefully it will be useful.