Skip to content

Handles not appearing in Windows build (Solved) #16

@jbvrtx

Description

@jbvrtx

Versions: Unity 2022.3.19f1, Runtime Transform Handle 0.1.4
Platform: Windows 10

Disclaimer: I managed to resolve this issue, but wanted to document it. It may be fruitful to add a little note to the readme.md in case others run into the same problem.

Expected behavior: Handles should appear when manipulating objects in a windows build.

Actual behavior: Handles do not appear in the scene when building for Windows. The following error message is displayed in the console:

ArgumentNullException: Value cannot be null.
Parameter name: shader
  at (wrapper managed-to-native) UnityEngine.Material.CreateWithShader(UnityEngine.Material,UnityEngine.Shader)
  at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00008] in <ab14d35a27c043688812ae199c64b5aa>:0 
  at RuntimeHandle.HandleBase.InitializeMaterial () [0x0000b] in <2f416ef01dc943199267b54df4d7efdb>:0 
  at RuntimeHandle.PositionAxis.Initialize (RuntimeHandle.RuntimeTransformHandle p_runtimeHandle, UnityEngine.Vector3 p_axis, UnityEngine.Color p_color) [0x00015] in <2f416ef01dc943199267b54df4d7efdb>:0 
  at RuntimeHandle.PositionHandle.Initialize (RuntimeHandle.RuntimeTransformHandle p_runtimeHandle) [0x00080] in <2f416ef01dc943199267b54df4d7efdb>:0 
  at RuntimeHandle.RuntimeTransformHandle.CreateHandles () [0x00026] in <2f416ef01dc943199267b54df4d7efdb>:0 
  at RuntimeHandle.RuntimeTransformHandle.Update () [0x00070] in <2f416ef01dc943199267b54df4d7efdb>:0 

Resolution: The issue was resolved by including the "sHTiF/HandleShader" and the "sHTiF/AdvancedHandleShader" in the "Always Included Shaders" list in the Graphics Settings.

Steps to reproduce:

  1. Create a new Unity project.
  2. Import the RuntimeTransformHandle package from the GitHub repository.
  3. Add the handles to an object in the scene view.
  4. Build the project for Windows.
  5. Observe that the handles do not appear in the scene view and the error message is displayed in the console.

Additional information: The issue was only observed when building for Windows. The handles worked correctly in the editor and when building for other platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions