Some (hopefully) simple questions

I’m mostly just a Unity developer and learning Niantic Studio… so just figuring out how to do simple things such as:

  • address/reference other scripts
  • booleans that are visible in the inspector
  • Enabling and disabling the visibility of objects
  • Screen space UI (from what I’ve read could be a nightmare and is generally encouraged to use world space?)

Any help would be appreciated!

Hi Mitch! Welcome to the forums!

In general the best design pattern at the moment is using a event dispatcher and event listener to communicate between entities, and exchange data. It’s a little different from the Unity approach where you grab a component directly from an entity and call some function on it.

It’s easy to add variables to the inspector, you just need to add them to your component schema. You can even apply different headers above the variable to change its behavior in the inspector like it’s Label or Group elements together.

There’s two approaches to changing the visibility of an object. You can either apply the Disabled component to an entity or you can hide its object3D by getting its object3D using three.js and setting visible to false.

https://threejs.org/docs/#api/en/core/Object3D.visible

We’re currently working on an example project and guide for UI. In the meantime I would start by creating a parent UI element, and adding children elements to it in the heirarchy while keeping in mind that our layout engine is based on CCS flexbox.

Forgot to say thanks for the above. Thank you!

I’m trying to implement a grid system. I’ll have a grid of squares (10x10) that I’ll want to be able to have the user fill with models that are sized either 3x3, 2x2, or 1x1 of that grid. I haven’t a clue where to start when setting something like this up, and was wondering if there was any potential examples or documentation I could look into that might help a bit (dealing with arrays or matrixs etc) or if you could help at all :slight_smile:

Thanks again!