[589] UdonBehaviour array type is not defined
tracked
Merlin
If you attempt to create an array of UdonBehaviours by naming the type VRCUdonUdonBehaviourArray, it does not get recognized as a valid Udon type and fails to assemble.
The alternate special case type "VRCUdonCommonInterfacesIUdonEventReceiver" that's used in other places that takes the place of UdonBehavior doesn't have an array type of "VRCUdonCommonInterfacesIUdonEventReceiverArray" defined either. So at the moment we need to use arrays of Component to represent arrays of UdonBehaviours.
This issue is probably related and seems like a workaround on the graph side or a bug that's hiding the issue: https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/udonbehaviour-variable-compiles-into-unityengineobjectarray-which-is-an-object
Log In
DarkPowers
I think this might be related https://feedback.vrchat.com/sdk-bug-reports/p/type-referenced-by-vrcudonudonbehaviourarray-could-not-be-resolved
Momo the Monster
Merged in a post:
Declaring a UdonBehaviour[] as a behaviour variable throws an error
FairlySadPanda
TypeResolverException: Type referenced by 'VRCUdonUdonBehaviourArray' could not be resolved.
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.CreateUninitializedDataVariable (System.String dataVariableName, System.String typeString) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.VisitDataDeclarationStmt (VRC.Udon.UAssembly.Parser.Stmt+DataDeclaration stmt) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.UAssembly.Parser.Stmt+DataDeclaration.Accept (VRC.Udon.UAssembly.Parser.Stmt+IVisitor visitor) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.VisitBlockStmt (VRC.Udon.UAssembly.Parser.Stmt+Block stmt) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.UAssembly.Parser.Stmt+Block.Accept (VRC.Udon.UAssembly.Parser.Stmt+IVisitor visitor) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.Process (VRC.Udon.UAssembly.Parser.Stmt statement) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.Assemble (System.String assembly) (at <7f6fa96f828e438b9b33c8d36d9ab918>:0)
VRC.Udon.EditorBindings.UdonEditorInterface.Assemble (System.String assembly) (at <0a39d8e3d985489da4e54bed9e5b6220>:0)
VRC.Udon.Editor.UdonEditorManager.Assemble (System.String assembly) (at Assets/Udon/Editor/UdonEditorManager.cs:292)
VRC.Udon.Editor.ProgramSources.UdonAssemblyProgramAsset.AssembleProgram () (at Assets/Udon/Editor/ProgramSources/UdonAssemblyProgram/UdonAssemblyProgramAsset.cs:82)
UnityEngine.Debug:LogException(Exception)
VRC.Udon.Editor.ProgramSources.UdonAssemblyProgramAsset:AssembleProgram() (at Assets/Udon/Editor/ProgramSources/UdonAssemblyProgram/UdonAssemblyProgramAsset.cs:90)
VRC.Udon.Editor.ProgramSources.UdonAssemblyProgramAsset:RefreshProgramImpl() (at Assets/Udon/Editor/ProgramSources/UdonAssemblyProgram/UdonAssemblyProgramAsset.cs:36)
VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UdonGraphProgramAsset:RefreshProgramImpl() (at Assets/Udon/Editor/ProgramSources/UdonGraphProgram/UdonGraphProgramAsset.cs:60)
VRC.Udon.Editor.ProgramSources.UdonProgramAsset:RefreshProgram() (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAsset.cs:106)
VRC.Udon.Editor.ProgramSources.UdonProgramAsset:RunEditorUpdate(UdonBehaviour, Boolean&) (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAsset.cs:82)
VRC.Udon.Editor.ProgramSources.UdonProgramAssetEditor:OnInspectorGUI() (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAssetEditor.cs:12)
VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UdonGraphProgramAssetEditor:OnInspectorGUI() (at Assets/Udon/Editor/ProgramSources/UdonGraphProgram/UdonGraphProgramAssetEditor.cs:11)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
Occurs both in U# and Graph.
Momo the Monster
Merged in a post:
Logspam when trying to work with UdonBehaviour[] using Udon Graph
bd_
I'm getting this exception when using an UdonBehaviour[] in a graph:
TypeResolverException: Type referenced by 'VRCUdonUdonBehaviourArray' could not be resolved.
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.CreateUninitializedDataVariable (System.String dataVariableName, System.String typeString) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.VisitDataDeclarationStmt (VRC.Udon.UAssembly.Parser.Stmt+DataDeclaration stmt) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.UAssembly.Parser.Stmt+DataDeclaration.Accept (VRC.Udon.UAssembly.Parser.Stmt+IVisitor visitor) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.VisitBlockStmt (VRC.Udon.UAssembly.Parser.Stmt+Block stmt) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.UAssembly.Parser.Stmt+Block.Accept (VRC.Udon.UAssembly.Parser.Stmt+IVisitor visitor) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.Process (VRC.Udon.UAssembly.Parser.Stmt statement) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.UAssembly.Assembler.UAssemblyAssembler.Assemble (System.String assembly) (at <133048a13ccf47a6a7fe569dc3238fdb>:0)
VRC.Udon.EditorBindings.UdonEditorInterface.Assemble (System.String assembly) (at <7bf6677a88024915b543ed8ea492e0b8>:0)
VRC.Udon.Editor.UdonEditorManager.Assemble (System.String assembly) (at Assets/Udon/Editor/UdonEditorManager.cs:292)
VRC.Udon.Editor.ProgramSources.UdonAssemblyProgramAsset.AssembleProgram () (at Assets/Udon/Editor/ProgramSources/UdonAssemblyProgram/UdonAssemblyProgramAsset.cs:82)
UnityEngine.Debug:LogException(Exception)
VRC.Udon.Editor.ProgramSources.UdonAssemblyProgramAsset:AssembleProgram() (at Assets/Udon/Editor/ProgramSources/UdonAssemblyProgram/UdonAssemblyProgramAsset.cs:90)
VRC.Udon.Editor.ProgramSources.UdonAssemblyProgramAsset:RefreshProgramImpl() (at Assets/Udon/Editor/ProgramSources/UdonAssemblyProgram/UdonAssemblyProgramAsset.cs:36)
VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UdonGraphProgramAsset:RefreshProgramImpl() (at Assets/Udon/Editor/ProgramSources/UdonGraphProgram/UdonGraphProgramAsset.cs:60)
VRC.Udon.Editor.ProgramSources.UdonProgramAsset:RefreshProgram() (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAsset.cs:106)
VRC.Udon.Editor.ProgramSources.UdonProgramAsset:RunEditorUpdate(UdonBehaviour, Boolean&) (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAsset.cs:82)
VRC.Udon.UdonBehaviour:RunEditorUpdate(Boolean&) (at Assets/Udon/UdonBehaviour.cs:141)
VRC.Udon.Editor.UdonBehaviourEditor:OnInspectorGUI() (at Assets/Udon/Editor/UdonBehaviourEditor.cs:161)
UdonSharpEditor.UdonBehaviourOverrideEditor:OnInspectorGUI() (at Assets/UdonSharp/Editor/Editors/UdonSharpBehaviourEditor.cs:456)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
and
NullReferenceException: Object reference not set to an instance of an object
VRC.Udon.Editor.ProgramSources.UdonProgramAsset.DrawInteractionArea (VRC.Udon.UdonBehaviour udonBehaviour) (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAsset.cs:119)
VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UdonGraphProgramAsset.DrawProgramSourceGUI (VRC.Udon.UdonBehaviour udonBehaviour, System.Boolean& dirty) (at Assets/Udon/Editor/ProgramSources/UdonGraphProgram/UdonGraphProgramAsset.cs:46)
VRC.Udon.Editor.ProgramSources.UdonProgramAsset.RunEditorUpdate (VRC.Udon.UdonBehaviour udonBehaviour, System.Boolean& dirty) (at Assets/Udon/Editor/ProgramSources/UdonProgram/UdonProgramAsset.cs:85)
VRC.Udon.UdonBehaviour.RunEditorUpdate (System.Boolean& dirty) (at Assets/Udon/UdonBehaviour.cs:141)
VRC.Udon.Editor.UdonBehaviourEditor.OnInspectorGUI () (at Assets/Udon/Editor/UdonBehaviourEditor.cs:161)
UdonSharpEditor.UdonBehaviourOverrideEditor.OnInspectorGUI () (at Assets/UdonSharp/Editor/Editors/UdonSharpBehaviourEditor.cs:456)
UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1647)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
These are continually being spammed in the logs.
After connecting the Get Length to the For, graph interactions are very slow, and each interaction generates more of these exceptions.
Momo the Monster
tracked
F
FZ_VR
As workaround, it is possible to use GameObject[] instead of UdonBehaviour[], and then use GameObject.getComponent(,Type_UdonBehaviour) to get the UdonBehaviour attached to the GameObject.