Search Unity

Bug PlayerInputManager.onPlayerJoined is called before Awake is run on instantiated prefab

Discussion in 'Input System' started by rhys_vdw, Aug 30, 2021.

  1. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    110
    Guess the title says it all. My Player.Awake (sibling component to PlayerInput) is not run before the callback is received. This violates normal assumptions around when Awake is run. The callback should be something like this:

    Code (CSharp):
    1. var instance = Instantiate(thePrefab);
    2. onPlayerJoined.Invoke(instance);
    Haven't poked around to see what's happening here.