InvokeMethod doesn't show Methods with Vector3 return value

FSpitzner

New member
Hi,
I'm trying to write a simple Targeting System and I'm using a MonoBehaviour on the same GameObject to find a new target.
All I need is to call a Method of that MonoBehaviour and it returns a new target in form of a Vector3. I was trying to use the InvokeMethod Action to call the method and save the return value in a local variable of that tree, but it didn't show up. Out of curiosity I tried to return a SharedVector3 instead and the InvokeMethod Action was actually able to pick up the method. I'm certain though, that this is not the intended way of doing that. Also I wasn't able to create a new SharedVector3 variable to return it anyway, since that always produced InvalidCastExceptions.
I tried to reproduce the problem in a fresh project and it was exactly the same.

Although I was able to force the InvokeMethod Action to use my Method by changing its type to SharedVector3 then select the Method in the Inspector and then change the methods return type back to Vector3. After that my Method was still selected in the inspector and did actually work as intended for a while. At some point though, it simply stopped working and I got an Error which broke all behaviours. I wasn't able to reproduce the braking action, but since it was a dirty workaround anyways, I didn't exactly put much time into that.

Is there a way to Invoke Methods with the return type Vector3 or is this a bug and it should work just as I tried?

I'm using BD 1.6.5 and Unity 2019.3.14f1.

Thanks
 
Thanks for letting me know. This is a bug and I'll send you a PM with the fix.
 
Top