UnityEvent issue with multiple copies of same script.

Issue #294 resolved
Former user created an issue

I'm getting a weird issue with serialized UnityEvents when two (or more) instances of the same scripts are on the same GameObject. The "+" and "-" controls in the inspector don't work for the first instance of the script, but on the second (or last) instance, the controls work, but actually create new handlers on ALL of the instances of the script, instead of just the one.

Tested in a completely new project. Imported Odin. Created the following script: using UnityEngine; using UnityEngine.Events;

public class Test : MonoBehaviour { [SerializeField] UnityEvent test; }

created an empty in the scene and added two instances of said script to it.

Comments (6)

  1. Dominic Antonelli

    I did a bit more testing, and have also noticed that the same issue occurs with two DIFFERENT scripts on the same object, if the UnityEvent variable has the same name.

  2. Bjarke Elias

    This one is also resolved in 1.0.6.1 If you want a hotfix for it just shoot us an email from our website with your Odin invoice Id, and I'll send it your way.

    We'll submit it to the asset store very soon. Writing patch notes as we speak.

  3. Log in to comment