I get it when using SendMessage. I have never seen it before and searches to the unity forums as well as google return zero results of any kind that reference this message.
Error: ShouldRunBehaviour ()
Anyone know what this means?
I get it when using SendMessage. I have never seen it before and searches to the unity forums as well as google return zero results of any kind that reference this message.
Error: ShouldRunBehaviour ()
Anyone know what this means?
Is this a method in your class by chance?
Hello
Iāve found the same problem.
I have one gameObject with two scripts in the first one I have this call:
SendMessage("updateData",null,SendMessageOptions.DontRequireReceiver);
And in the second one Iāve an updateData method. It works but it shows this error on the console.
ShouldRunBehaviour ()
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
ScriptAonChanged() (at assets/Scripts/ScriptA.cs:56)
ScriptAInspector:OnSceneGUI() (at assets/Editor/ScriptAInspector.cs:64)
UnityEditor.DockArea:OnGUI()
Did you find any solution?
Thanks
Itās probably much like IEnumerator.MoveNext is with coroutines - itās what Unity uses behind the scenes to carry out the SendMessage functionality. If you look 1 line below it in the stacktrace, itāll point you to where the actual error is (in the most recent post, line 56 of ScriptA.cs).
Thank you StarManta,
It seems that the problem is that sendMessage has to be used on run and it works on edit but showing this error message.
Iām looking for any other solution to do this during edit.
Whenever you get an error message like āShouldRunBehaviour()ā or āo != iā or āIsFinite(result)ā, thatās a failed assertion. Assertions are like exceptions, but they donāt show the line number of the error, or any usefull information at all.
So what youāre seeing is probably the result of a line looking like this:
Debug.Assert(ShouldRunBehaviour());
Where Debug is System.Diagnostics.Debug, not UnityEngie.Debug.
If you are using Unity 4.6 or above you could make this go away by refactoring out the SendMessage call and replacing it with ExecuteEvents. This may or may not be worth the hassle.
Thank you Baste and BoredMormon,
Finally the ExecuteEvents solution is what Iāve found it solves the problem.
ExecuteEvents works well (and quietly) in edit mode, but it doesnāt offer an easy way to recurse down the hierarchy. Youāll have to iterate over all the children yourself.
Hey,
I was running in the same issue and used System.Reflection and .Invoke to solve this error message. It is a relatvely good alternative in my opinion.
MethodInfo tMethod = TargetObjects[i].GetType().GetMethod(tAttribute.FunctionName);
if(tMethod != null)
{
tMethod.Invoke(TargetObjects[i], null);
break;
}
Because the method cannot run in editMode,you should add ā[ExecuteInEditMode]ā
if you want to call the āUpdateā method through a SendMessage from the āedit modeā, make sure the MonoBehavior you are sending the message to has the ārunInEditModeā property set to true.
[ExecuteInEditMode] worked for me. Thanks!
Can someone help me? I get this error message:
Assertion failed on expression: āShouldRunBehaviour()ā
UnityEngine.Canvas:SendWillRenderCanvases()