Skip to content
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

Time Scale & Target Frame #105

Open
yanjingzhaisun opened this issue Dec 29, 2019 · 1 comment
Open

Time Scale & Target Frame #105

yanjingzhaisun opened this issue Dec 29, 2019 · 1 comment

Comments

@yanjingzhaisun
Copy link

yanjingzhaisun commented Dec 29, 2019

Issues

When changing Time.timeScale, the raycast on the ground doesn't work properly. It keeps bounce the character back above.

Normal (Time.timeScale = 1f)
Normal
https://media.giphy.com/media/XGt7SbvRbvBiwBUR6K/giphy.gif

Wrong (Time.timeScale = 0.2f)
Wrong
https://media.giphy.com/media/QC6lhQ4qb15FDVkzC7/giphy.gif

Additionally, if the framerate is not capped to 60, the bouncing effect will be even more obvious.

Possible Problem

When checking CharacterController2D.cs, in moveVertically(ref deltaMovement) function, something weird happens there.
deltaMovement.y was set to be skinWidth. Which possibly means the origins of raycast are set up wrong.
No idea why this only happens when Time.timeScale goes low.
Apparently the the ray distance is so small, that eventually the skin layer is already beneath the platform. It make sense to bounce it back to the surface, however, I don't know why it keeps going up instead of stops there.

Thank you very much for developing such a brilliant plugin!

@yanjingzhaisun
Copy link
Author

Sorry, get back to read about numerical analysis again, this is because the physics simulation. Not a problem of the plugin, simply the simulation is not precise enough for lower timescale. Potentially if switched to Time.unscaledTime in Update() function would fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant