Skip to content

Opsive/MLAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netcode for GameObjects

WIP for Opsive Character Controller networked using the Unity Netcode for GameObjects.

Project Setup

project

Basic networked menu for testing, with some basic customization using unity GUIStyle.

Networked Menu

gui

Unity sytle networking menu gui, help with testing Server/Client connection setup.

Networked GUI

gui

Player Tool

project

Tools => GreedyVox => Networked => Character Inspector
Setting up the player UCC prefab, use the tool menu to open up the dialog box, drag the Player prefab into the input field and than hit the Update Character button.

Tool Setup

tool

The Player prefab will now have all the networking scripts added and ready for networking, the Player prefab should look like the screen-shot below.

Player Prefab

player

Ai Tool

project

Tools => GreedyVox => Networked => Character Ai Inspector
Setting up the Character Ai UCC prefab, use the tool menu to open up the dialog box, drag the Character Ai prefab into the input field and than hit the Update Character button.

Tool Setup

tool

The Character Ai prefab will now have all the networking scripts added and ready for networking, the Character Ai prefab should look like the screen-shot below.

Ai Prefab

ai

Object Setup

object

All prefabs assigned to he UCC Object Pool will automatically be pooled with the Networked Object Pool, when using the interface for spawning the prefabs over the network.

Object Pooling

pooling

Provides built-in support for Object Pooling, allows to override the default Netcode destroy and spawn handlers, for storing destroyed network objects in a pool for reuse.

m_SpawnObject = ObjectPool.Instantiate (m_CloneObject, Vector3.zero, Quaternion.identity);
NetworkedObjectPool.NetworkSpawn (m_CloneObject, m_SpawnObject, true);

Networked Pickup Item

gui

Pickup items must be added to the networked pool and spawned in at runtime, pickup items cannot be in the OPSIVE Object Pool, otherwise they will all spawn into the game world.

Spawning the pickup item into the game world at runtime.
[SerializeField] private GameObject m_SwordPickup;
private void Spawn () {
    var go = ObjectPool.Instantiate (m_SwordPickup, Vector3.zero, Quaternion.identity);
    NetworkedObjectPool.NetworkSpawn (m_SwordPickup, go, true);
}

Pickup Tool

project

Tools => GreedyVox => Networked => Item Pickup Inspector
Setting up the Pickup Item UCC prefab, use the tool menu to open up the dialog box, drag the Pickup Item prefab into the input field and than hit the Update Item button.

Pickup Tool

gui

The Pickup Item prefab will now have all the networking scripts added and ready for networking, the Pickup Item prefab should look like the screen-shot below.

Tool Setup

tool

Networked Prefabs

gui

Spawning prefabs into the game world must be in the network prefab list, this will insure that server will spawn automatically across networked clients.

Watch video below to see everything in action.

YAARRGH! Battle Island!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages