Skip to content

Disabling/re-enabling interpolated gameobject will break InterpolationObjectController #2

@onlinefrog

Description

@onlinefrog

I know this repo hasn't been updated in a while but I wanted to point this out for people coming across it.

Since the coroutines in InterpolationObjectController are started in Awake and are automatically stopped upon the gameobject being disabled, re-enabling said gameobject will not re-enable the coroutines, which had me stuck for a while. I haven't tested this, but I think the lines:

StartCoroutine(WaitForEndOfFrame());
StartCoroutine(WaitForFixedUpdate());

Should be moved to OnEnable()

Otherwise it works well! Thanks.

That said, I decided to use the three scripts from the original article, as I wanted to avoid allocations with StartCoroutine.
https://kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8?utm_type=SMVideo

Have a good one : )

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