Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed parameters of gameobject type is not serialized causing nullref exception during runtime. #54

Closed
RedTheKitsune opened this issue May 17, 2020 · 1 comment

Comments

@RedTheKitsune
Copy link

RedTheKitsune commented May 17, 2020

When setting exposed parameter of gameobject type from code using exposedParameters[0].serializedValue.value , there is no data in exposedParameters[0].serializedValue.serializedValue which causes this error:

System.NullReferenceException
  at (wrapper managed-to-native) UnityEngine.GameObject.get_transform(UnityEngine.GameObject)
  at GetPositionNode.Process () [0x00001] in F:\Projects\FatalSet\Assets\_FS\Script\NodeSystem\Nodes\GameObjectNodes.cs:30 
  at GraphProcessor.BaseNode.<OnProcess>b__49_0 () [0x00000] in F:\Projects\FatalSet\Library\PackageCache\com.alelievr.node-graph-processor@92ac41e0ce\Runtime\Elements\BaseNode.cs:351 
  at GraphProcessor.ExceptionToLog.Call (System.Action a) [0x00002] in F:\Projects\FatalSet\Library\PackageCache\com.alelievr.node-graph-processor@92ac41e0ce\Runtime\Utils\ExceptionToLog.cs:14 
UnityEngine.Debug:LogError(Object)
GraphProcessor.ExceptionToLog:Call(Action) (at Library/PackageCache/com.alelievr.node-graph-processor@92ac41e0ce/Runtime/Utils/ExceptionToLog.cs:19)
GraphProcessor.BaseNode:OnProcess() (at Library/PackageCache/com.alelievr.node-graph-processor@92ac41e0ce/Runtime/Elements/BaseNode.cs:351)
NodeGraphProcessor.Assets.Examples.ConditionalGraph.<RunConditionalGraph>d__13:MoveNext() (at Assets/Samples/Node Graph Processor/0.6.0/Examples/ConditionalGraph/ConditionalProcessor.cs:154)
NodeGraphProcessor.Assets.Examples.ConditionalGraph.ConditionalProcessor:Run() (at Assets/Samples/Node Graph Processor/0.6.0/Examples/ConditionalGraph/ConditionalProcessor.cs:51)
AIController:Update() (at Assets/_FS/Script/AIController.cs:149)

I think ConditionalProcessor needs to use serializedValue.value when serializedValue.serializedValue returns empty string or use only serializedValue.value during runtime execution.

@RedTheKitsune RedTheKitsune changed the title 2 frame gameobject serialization delay causes nullref exception during runtime graph execution. Exposed parameters of gameobject type is not serialized causing nullref exception during runtime. May 18, 2020
@alelievr
Copy link
Owner

Hello, I tried locally to assign a gameObject to a GameObject parameter from a script using this function and it seems to work well

			graph.SetParameterValue("GameObject", assignedGameObject);

Do you have any other details that could helpm me reproduce this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants