How can we pass a object with unity event. I'm getting this error. But passing string is okey.
"ArgumentException: Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.GameObject'."
4 messages · Page 1 of 1 (latest)
How can we pass a object with unity event. I'm getting this error. But passing string is okey.
"ArgumentException: Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.GameObject'."
It seems (to my surprise) that "this" and "this.gameObject" are not the same. The former one refers to the instance of the object, while the latter refers to the game object.
The difference is not clear to me, but it seems like you should use "this.gameObject"
Ah, got it... "this" is the instance od the script itself