Unity
Environment
Section titled “Environment”- Tested version: Unity 6000.6.7f1 on Windows 11.
- Supported versions:
package.jsonspecifies"unity": "6000.0"(Unity 6000.0 or later). - Package dependencies:
com.unity.nuget.mono-cecil(1.11.6).
Installing the plugin
Section titled “Installing the plugin”Git URL
Section titled “Git URL”- Open your project in Unity.
- Open the Package Manager window (
Window > Package Manager). - Click the
+button, select Install package from git URL, and enter:
https://github.com/crane-valley/cluewren.git?path=plugin/unity/com.cranevalley.cluewrenLocal path
Section titled “Local path”- In the Package Manager window, click the
+button and choose Install package from disk. - Go to the clone’s
plugin/unity/com.cranevalley.cluewrenfolder. - Double-click its
package.json.
Connecting to the brain
Section titled “Connecting to the brain”Open Window > Cluewren to open the Cluewren editor window (PlaytestWindow.cs). The window displays the connection state: “Disconnected”, “Connecting”, “Connected”, or any connection error.
- Automatic connection: The plugin checks for
%LOCALAPPDATA%\Cluewren\brain.jsonevery 2 seconds. When the brain process starts, the plugin connects automatically over loopback WebSocket (ws://127.0.0.1:<port>/v1/bridgeor[::1]). - Manual control: Use the Connect and Disconnect buttons in
Window > Cluewrento open or close the bridge link manually. - Play mode reload: Entering play mode reloads assemblies unless the project disables domain reloads. The connection closes with WebSocket code 1012 and reconnects with
hello {"resume": <session>}to preserve the active run session.
Folders
Section titled “Folders”- Memory folder:
<project>/UserSettings/Cluewren/(containsnotes.md,lib.cs, andruns/<yyyyMMdd-HHmmss>/). - Text export folder:
<project>/Library/CluewrenCodex/(holds the project as text:summary.txtfirst, thenscenes/,prefabs/,data/,scripts.txt,build_scenes.txt, andinput/for action maps).
Kit and playtest notes
Section titled “Kit and playtest notes”- Object paths: GameObjects use the format
<scene>:/<root>/<child>(for example,Main:/Level/Door). Paths starting with/search across all loaded scenes. Objects sharing a name under one parent are indexed:Coin,Coin@1,Coin@2. Components use<object path>|<Type>(for example,Main:/Player|PlayerMover). Static types usetype:<Full.Name>or a short name when unique. - Finding objects:
game.Actors("Door")returns GameObjects with a component of that type (including interfaces and subclasses).game.AllActors()lists top-level scene objects.game.Named("door")finds by name. Inactive objects can be listed withgame.Request("find", ...). - Reading and calling: Use
game.Get,game.Props,game.Call, andgame.Describe. Native coordinates are in metres (x right, y up, z forward). Convert between native coordinates and kit coordinates usinggame.ToKit(value)andgame.ToNative(vec). - Player detection: The plugin looks for an object tagged
Player, then an object withPlayerInput, then one withCharacterController.Movement(game)reads CharacterController parameters and movement script fields (walkSpeed,jumpSpeed, etc.). - Input: Simulates hardware devices via the Input System. Use standard key names (
W,SpaceBar,E,LeftShift,LeftMouseButton,MouseX,MouseY, etc.) or action names (game.Press("Player/Jump"),game.Hold("Player/Move", new[] { 0.0, 1.0 })). Mouse look requires runninggame.CalibrateLook()once, followed bygame.TurnorLookAt. - UI: Screen-space canvas text (uGUI Text, TextMeshPro) and UI Toolkit elements are read via
game.Screen(). Interactive elements are listed bygame.Ui()and clicked viagame.UiAct(). IMGUI (OnGUI) cannot be read or clicked. - Sessions: The editor playtest session is play mode.
game.Restart()reloads the initial scene. Objects preserved withDontDestroyOnLoadsurvive scene reloads. - Omitted from
game.View(): The Unity plugin omitsheld,openings,ways_up,point_blank, andlane. Becauseways_upis omitted,WalkTocannot pathfind up ramps or stairs on its own; pass waypoint coordinates fromgame.Locs.