Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

NextFrame() skips second frame #515

Open
subGlitch opened this issue May 25, 2022 · 0 comments
Open

NextFrame() skips second frame #515

subGlitch opened this issue May 25, 2022 · 0 comments

Comments

@subGlitch
Copy link

subGlitch commented May 25, 2022

Repro:
Create empty project, import UniRx, add new GameObject to the scene with Test component, containing following code:

public class Test : MonoBehaviour
{
    void Start()
    {
        Debug.Log( $"Cur frame: {Time.frameCount}" );

        Observable
            .NextFrame()
            .Subscribe( _ => Debug.Log( $"Next frame: {Time.frameCount}" ) );
    }
}

Result:
After entering Play Mode there will be following output in the console:

Cur frame: 1
Next frame: 3

Expected behavior:

Cur frame: 1
Next frame: 2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant