sync player char that moves with nav mesh agent

Options
NightCore
NightCore
edited March 2022 in Fusion

Hello im moving my player using the nav mesh agent's move in FixedUpdateNetwork, when I add a network transform component to sync its position, it suddenly moves very slowly. any1 have any idea how do I properly sync this across then network??

Comments

  • Tobias
    Options

    The Fusion 100 series of docs is likely the best explanation of how to use Fusion in general and the NetworkTransform in this case.

    With the little info there is, I can't really guess why this happens. Maybe someone else has an idea?!

  • NightCore
    NightCore
    edited March 2022
    Options

    is there a click to move with nav mesh example?

  • Tobias
    Options

    No. That would mostly be a Unity sample and doesn't really relate to the networking itself.

  • NightCore
    Options

    sry I meant a click to move example using nav mesh with client side prediction and rollback

  • emotitron
    emotitron ✭✭✭
    Options

    Nav Agent with client prediction from what we have seen is expensive and difficult to make work with prediction/resimulation. So typically you not predict these things, and only run them on the server - and then push the state to clients with NetworkTransform. This means they will exist in the Snapshot timeframe on clients, which makes them candidates for Lag Compensation instead.

  • NightCore
    NightCore
    edited March 2022
    Options

    @emotitron thanks for ur answer, but why do I need lag compensation for this? unless I click an enemy to attack? or casting a spell?

  • emotitron
    emotitron ✭✭✭
    Options

    It depends what is predicted in your use case. It sounds like in your case your actual player (not just AI) is using a nav mesh - which makes this a somewhat complicated problem unless you just forgo player prediction entirely. Nav Mesh does not inherently resimulate well, so its not a great candidate for prediction - and no simple guidance can really be given here on the topic, since it actually involves making a nav mesh that is capable of resimulation.