Creating Objects for Varwin in Unity

Video Guides

Here you will find the video guides showing how to create objects for the Varwin RMS platform.

Creating a Button

Creating a Light Bulb

Creating a Screen

Creating objects

  1. Create or import a game object and save it as a prefab.
  2. Select the prefab in its folder.
  3. Open VARWIN SDK -> Create -> Object
  1. Select an object, name it. Add tags for fast search. Fill in the info about the object’s author.
  2. Click Create. You’ll be asked to wait several moments.
  1. Your object has been created. It consists of: a. object prefab, b. .asmdef file (for object code compilation), c. object class stored in a unique namespace. Should the need arise to add more classes, they will have to be stored in the same directory and the same namespace.
  1. SimpleButton class has been created for the object. It inherits VarwinObject. This is the main object class, which connects the object with the platform.
using UnityEngine;
using Varwin.Public;
namespace Varwin.Types.Cube_68bc9ae493d843aab141939fcd529513
    public class Cube : VarwinObject
        void Start()

        void Update()
  1. Everything is ready for writing object code.


The object has a method “ChangeState” in its main class. The method changes bool variable IsPressed.

public void ChangeState()
           isPressed = !isPressed;
           _animator.SetBool("Pressed", isPressed);

To connect this method with the action of pulling the trigger on a controller (“Use”): select method “ChangeState” in Interactable Object Behavior.


You will have to create a function for Blockly, write an attribute for it (in this case, Checker) and name it.

[Locale(SystemLanguage.English, "button pressed")]
public bool ButtonPressedChecker()
   return isPressed;

Should this object have several methods, Blockly will group them within one block within this name.

  • E.g., if we create another state of the button, “is released”,
   [Locale(SystemLanguage.English, "is released")]
   public bool IsReleased()
       return !IsPressed;
  • Blockly will group these methods this way:

Everything is ready for object building. Click Build.


When the object is ready, the folder containing it will open. Now you can upload the object into the Varwin library.


The object appears in the library.


Now you can place the object into a scene in VR. Click Save. Now the object appears in the scene. Open Blockly. You’ll see logic blocks that have been created for the object.

../_images/image164.png ../_images/image214.png

Working with attributes

Ways of working with attributes are described here: Working with attributes

Objects, scene templates versioning

Create new versions of existing objects and scene templates.

Objects, scene templates versioning: instruction