This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
Begin
Antoine Charton edited this page Feb 7, 2018
·
68 revisions
If you are not familiar at all with unity I suggest you start with the interface tutorials first. This tutorial assumes that you are at least some basic knowledge of it.
- How to setup constellations.
- The basic of the interface.
- The basic principles of Constellation scripting.
- Controlling a gameobject.
- You need the latest version of unity
- When your unity is installed, you can Download or clone the repo.
- Open the project with unity 2017.3.
- Open the constellation Window. Can be found in Unity menus in Window/Constellation Editor.
- Once it's done, click Load Constellation button and open bird.asset.
- Constellation tab: Currently open constellation.
- Node selection panel: The node list. Click one in the list to add it.
- Node editor: Where you edit your scripts.
- Open the FlappyBird scene.
- Hit play.
- Click on gameobject that has a constellation script attached. In this example, it's pref_bird
- You should see the live values.
- Create a new scene.
- Create a new GameObject.
- Add a Constellation behaviour component to your GameObject
- Add your Constellation script the script field.
- Click on the question mark on a node to get more information about it and examples
For this section it's advised to have a unity and constellation window opened. It's will help you understand how it works
- Create a new Scene.
- Create a new Constellation. From Constellation editor, click file/new. The shortcut is ctrl+alt+n. Give your script a cool name!
- Create a new Gameobject and add a constellationBehaviour component. Add your script with a cool name to the constellation behaviour.
- Inputs set variables in the node.
- Outputs are the result.
- A Variable is either a number, a string, an array, an object, or a list of variable (Very similar to the war in javascript).
- A Unity variable is an object which inherits from unity object (Example transform, GameObject, Component).
- Links allow you to connect a node output to a node input.
Quick example
- For this one I suggest you try to reproduce the examples and experiment with them. It will be easier for you to understand how it works.
- Add a word node (Is inside Basics nodes namespace) and 2 var nodes.
- Connect them to reproduce what's on the image below.
- Select the Gameobject on which you assigned your cool script and hit play.
- You can see that the first var is set, but the second one is not. It's because a cold input is used to set a variable. It does not trigger an output.
- To fix that you need to tell the var node push its value. To do so, we will add an Update node and connect it to the warm input of the var.
What should I remember
- A cold input sets a value but do not push it
- A warm input will trigger an output.
- A warm output is triggered without warm input. For example keyDown node will trigger an output because a key is pressed.
- A cold output is triggered only when a warm input receives a message.
- In constellation nodes are executed from top to bottom.
- To test that just add a word node and a print node. Enter in the attribute field "Word 1" and connect it to the print.
- Add another word node, place it bellows the previous word, set the field to "Word 2" and connect it to the print node.
- Select your cube make sure your constellation editor is opened and hit play!
- You should see in the console
Word 1
Word 2
- Stop playing.
- Now try to put the word 2 node on top of the word 1.
- You will see now that word 2 is printing before word 1.
Word 2
Word 1
- Create a new Constellation.
- Add it to a cube.
- Add a transform node.
see that A transform node has 5 inputs
- The transform (default is the gameobject to which it's attached)
- Position (Vec3).
- Rotation (Vec3).
- Scale (Vec3).
- Push values (Trigger the outputs).
It has 4 outputs
- The position.
- The rotation.
- The scale.
- The transform.
- If you want to see more details on the inputs or outputs you can right click over one. It will show you basics informations.
- To set the position you will need a Vec3 node. Add one and connect it to the second intput of the node (see image).
- You can try messing around with the values to understand a bit how it works.
Interface
- Reproduce the script on the image below and understand what it does using internal documentation.
- Assign it to a Gameobject.
Scripting
- Move the Y position instead of the Z position.
Bonus: Warm and cold
- Try to print in the console the rotation on the X axis of the transform (hint: you will require a split Vec3 node).
[Error codes] link