#Need help converting my movement script to work with netcode

1 messages · Page 1 of 1 (latest)

whole spire
#

I need to finish this multiplayer game for a school project, problem is i have no clue how to convert my singleplayer movement script to work with NGO. I need the simplest possible way to make it work, anyone with experience with NGO have any clue how to help?

#

also using unity 6000.3

quasi coral
#

Since you dont give so much information what kind of method you been looking for then i only give you some basic idea how it goes. it either send input via RPC then let server move the object or attach network transform component and set to owner authority.

add using Unity.Netcode and change from MonoBehaviour to NetworkBehaviour

or you just completely beginner

#

(Server Authority)
-Add component called Network Object and Network Transform set Authority mode to Server
-Declare using Unity.Netcode and NetworkBehaviour
-Send input via Rpc, NetworkVariable or CustomMessage to the server.
-Server will move object and synchronize to all clients

(Owner Authority)
-Add component called Network Object and Network Transform set Authority mode to Owner
-Declare using Unity.Netcode and NetworkBehaviour
-For every transform states changed it will automatically synchronize to all connection.

calm birch
#

The simplest way is the Owner Authority route described above. You'll have to add some if (IsOwner) checks to ensure that each local client is the one carrying out their movement, allowing NetworkTransform to sync the resulting position to all other clients.

#

and please consider going back to your teacher and telling them that this is not a helpful assignment lol. Converting a singleplayer game is one of the worst ways to learn multiplayer for the first time, yet we get an endless amount of students coming in here looking for help on this same assignment.