All pages
Powered by GitBook
1 of 1

Loading...

Sinespace Scripting Documentation

Sinespace Scripting Documentation

This documentation is in progress. Please visit this page to report any issues, missing information, corrections or suggestions you may have.

Introduction

Scripting in Sinespace uses the Lua programming language.

Sinespace offers scripters Unity components, which are added to GameObjects, that will run the scripts(code) that we write inside them.

These Unity components come within the Sinespace Editor Pack package, which needs to be installed in our Unity project before we begin scripting.

Our core class is the class, which is accessed by writing "Space".

Example: Space.Log('Hello World') is equivalent to .

All of your functions/properties will be accessed starting with 'Space' which also navigates to other classes. There's very few exceptions that are accessed directly such as "Math" () and "Color"().

Example: Space.Network.SendNetworkMessage() this starts with the class and goes into the class.

Client Scripts vs Server Scripts

Client scripts run client-side, and Server scripts run server-side.

Browsing the left panel of this documentation you will find that our API Reference is split into two different parts - Client Scripting and Server Scripting.

Your first Client Script

To begin creating your first Sinespace Client Script, make sure you have the Sinespace Editor Pack properly installed, and then:

  • Select your GameObject

  • Click Add Component

  • Search for and select Scripting Runtime

  • Enter your code in the Script Contents text box - for example

Your first Server Script

It's recommended that new scripters familiarize themselves with Client scripts first before jumping into Server scripts, or creating more complicated objects that require server scripts.

Visit the to begin your first Server script.

Space.Log('Hello World!')
  • Press Play Scene (you should see your "Hello World!" in the Unity console window)

  • SScript
    SScript.Log('Hello world')
    SMath
    SColor
    SScript
    SNetwork
    Server Scripts guide