Skip to content

Interaction between ManualControl and Update/FixedUpdate #588

@cBournhonesque

Description

@cBournhonesque

What you did

I have a system that handles an Action in FixedUpdate because the action must be frame-time insensitive (also because of networking).
I try to set the action manually in PreUpdate during ManualControl.

I network my actions using ActionDiffs that are generated in FixedUpdate, bceause I need tick information.

But then the ActionData becomes

value: 0.0
update_value: 13.4
fixed_update_value: 0.0

i.e. since I set the Action value manually in PreUpdate, it only updates the update_value and not the fixed_update_value; so I cannot generate accurate diffs from it.

I'm not sure if it's a bug in lightyear, a bug in leafwing or just expected but I think it might be helpful to bring it up.

Solution

The solution was to put my system that manually updates the ActionState in FixedPreUpdate, so that the ActionDiffs are generated correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions