Another potential macOS bug - UnitSpawner now only works in Build, not Editor

I’m getting some unexplainable things going on here with 2020.1.2f1. A few lectures ago I had a bug that presented itself in the Build if it was the host. Now I’m finding the Editor will not spawn the UnitSpawner prefab which prevents any gameplay from being possible. Meanwhile, everything works perfectly in the Build (including all the selection code we added).

I’m very curious where all this odd behaviour is coming from. The course is already incredibly taxing on my poor brain, let alone with these random things that are showing up!


Update: I downloaded this lecture’s code from the Gitlab repo and can confirm the same behaviour in the Editor with @Nathan_Farrer’s code. However, I’m seeing different behaviour in the Build, where the unit selection indicator (green circle) isn’t showing! I’m convinced it’s at least a macOS issue now though, and not a misstep on my behalf.

When the UnitSpawner prefab doesn’t appear are you getting any error logs in the console? No one else has come with any issues on this and sadly I don’t think I can reproduce without any more info/logs. I’ll look into whether there are any known Mac issues being discussed in the Mirror forums and community.

Hi Nathan,

No errors in console, only the null reference exception for the player that we are expecting.

All I did was grab your rep for the Select Multiple Units lecture, open it in 2020.1.2 and change the input system to “both” to make the HUD buttons work (which was my first Mirror/Mac bug).

I have the same error also unit macOS, did you happen to know what the issue is

I did a work around if anyone is interested, I created a function to get the player, and did and invoke after 2 seconds in update if the player is null

private void GetPlayer()
{
player = NetworkClient.connection.identity.GetComponent();
}

// Update is called once per frame
private void Update()
{
    if (player == null)
    {
        Invoke(nameof(GetPlayer), 2.0f);
    }
1 Like

@TheAK Sadly I didn’t find a work around for this. I actually gave up on the course as I had other work to do and couldn’t afford the time to figure this out. :frowning: I’ll give this a go first chance I get. Thanks for posting! (It’s nice to know it might be a legit issue on macOS, not just me doing something silly)

I’m running Untiy 2020.1.17fa on Linux and I have the same problem, however, it seems to be random for me, sometimes I can spawn other times I can not.

@Nathan_Farrer - Also not seeing any extra errors in the log:

Hey All,

Found the fix here: Turning on the selection box is blocking clicks to the Unit Spawner

In short, you need to unfix the “Raycast Target” on the image.

4 Likes

Privacy & Terms