> For the complete documentation index, see [llms.txt](https://netick.gitbook.io/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://netick.gitbook.io/v1/core-concepts.md).

# Core Concepts

### **Network Sandbox** <a href="#network-sandbox" id="network-sandbox"></a>

Network Sandbox is what controls the whole network simulation. It can be thought of as the manager of the simulation. You can have more than one network sandbox in a single Unity game, and that happens when you start both a client and a server on the same project. This can be extremely useful for testing/debugging, because it allows you to run a server and a client (or multiple thereof) in the same project and therefore see what happens at both at the same time, without interference.

* Therefore you can think of a sandbox as representing a server or a client.
* You can show/hide the current sandboxes from the Network Sandboxes panel.

### **Network Object** <a href="#network-object" id="network-object"></a>

Any GameObject which needs to be synced/replicated must be a Network Object (has the Network Object added to it). If you want to see something on everyone’s screen, it has to have a Network Object component added to it. It’s the component that tells Netick that a GameObject is networked. The Network Object component by itself just informs Netick that the object is networked. To add networked gameplay-logic to it, you must do so in a component of a class derived from Network Behavior. Netick comes with a few essential built-in components:

* Network Transform: used to sync position and rotation
* Network Rigidbody: used to sync controllable physical objects
* Network Animator: used to sync Unity’s animator’s state

### **Network Behavior** <a href="#network-behavior" id="network-behavior"></a>

The Network Behavior class is your old friend MonoBehaviour, just the networked version of it. To implement your networked functionality, just create a new class and derive it from NetworkBehavior. You have several methods you can override which correspond to Unity’s non-networked equivalents (they must be used instead of Unity’s equivalents when doing anything related to the network simulation):

* NetworkStart
* NetworkDestroy
* NetworkFixedUpdate
* NetworkUpdate
* NetworkRender

Example:

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Netick;

public class MyBehaviour : NetworkBehaviour
{
    [Networked]
    public int   IntPropertyExample   { get; set;}
    
    [Networked]
    public float FloatPropertyExample { get; set;}
    
    public override void NetworkStart() 
    {
        // Called when this object has been added to the simulation.
    }

    public override void NetworkDestroy() 
    {
        // Called when this object has been removed from the simulation.
    }

    public override void NetworkUpdate() 
    {
        // Called every frame. Executed before NetworkFixedUpdate.      
    }

    public override void NetworkRender() 
    {
        // Called every frame. Executed after NetworkUpdate and NetworkFixedUpdate.
        // IMPORTANT NOTE: properties (which can be interpolated) marked with [Smooth] attribute will return interpolated values when accessed in this method.
    }

    public override void NetworkFixedUpdate() 
    {
        // Called every fixed-time network update/tick. Any changes/updates to the network state must happen here.
        // Check out the chapter named "Writing Client-Side Prediction code" to learn more about this method. 
    }

}
```

Don’t forget to include `using Netick`

A class derived from Networked Behavior is almost useless without the utilization of Network Properties, which are the building blocks of your networked synced state. These properties are ensured to be eventually synced to everyone in the network, letting you create objects with complex states and not worry about it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://netick.gitbook.io/v1/core-concepts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
