Unity Multiplayer - MLAPI and the new Input System

preview_player
Показать описание
This video shows how to get host / client player movement running on Unity using the MLAPI multiplayer package and the new Input System with Input Actions.
There is a brief example of how to set up a basic GUI / Canvas for each of the Host and Client objects.
This is not an example of quality code, it's a bodge to get the two package to play nicely with each other.
Рекомендации по теме
Комментарии
Автор

Great video and I was able to learn how to fix an issue after watching it. I want to share with others that the framework has been updated so there are some gotchas.

cheezcola
Автор

Also use inPlayerMovementManager this : public override void OnNetworkSpawn() //instead of Start

haraldgundersen
Автор

Awesome video, im in the middle of learning Mlapi with input system and this was very helpful. If your going to do more videos, id love to see how u add complete server authoritative. Cause atm this is client controlled correct?. Thanks again for the content!

shawno
Автор

Still working with small modifications with Netcode. 2022.09.30 (newest tools)

haraldgundersen
Автор

it did not work in the end, followed all of ur steps!, did it work for u?

mathiolia
Автор

With NetCode now use this:
using Unity.Netcode.Components;
using UnityEngine;

namespace
{
/// <summary>
/// Used for syncing a transform with client side changes. This includes host.
/// Pure server as owner isn't supported by this. Please use NetworkTransform
/// for transforms that'll always be owned by the server.
/// </summary>
[DisallowMultipleComponent]
public class : NetworkTransform
{
/// <summary>
/// Used to determine who can write to this transform. Owner client only.
/// This imposes state to the server. This is putting trust on your clients.
/// Make sure no security-sensitive features use this transform.
/// </summary>
protected override bool OnIsServerAuthoritative()
{
return false;
}
}
}

haraldgundersen
visit shbcf.ru