Skip to content

Time Scale & Target Frame #105

@yanjingzhaisun

Description

@yanjingzhaisun

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions