0
\$\begingroup\$

I have a game that I made in Unity and I have a windows build for it. It works fine on windows no problems there but I want to make a mac version of it. To make a mac version will it work if I just build it for mac or will I have to reprogram it for mac? I don't have a mac to test this and obviously I dont want to release a broken game. Note that the game uses the command Input.GetMouseButtonDown(0) a lot, not sure if you need a different command for a mac mouse.

\$\endgroup\$
1
\$\begingroup\$

To make a mac version will it work if I just build it for mac

Yes, with a giant asterisk.

You can indeed generate a Mac build from your Unity project on Windows, and most things should work fine when it's run on a Mac. The whole point of a cross-platform engine like Unity is to insulate your project from platform-specific details, as much as it can. So going via the Unity input system, you can read mouse input no matter what the underlying OS or mouse driver, etc. You should not have to reprogram large parts of your game.

But the only way to be certain is to test.

Some things that do vary between the platforms:

  • The numbered order of buttons and axes on gamepads are not guaranteed to be the same (since it's up to the driver to number them)

  • When you read from a render target in a shader, under some circumstances your result may be flipped vertically on Mac because of differences in how DirectX and OpenGL address textures (Unity automatically corrects most instances of this, but render textures occasionally pose corner cases it can't fix for you)

  • This list is incomplete. I'll leave this as Community Wiki so developers can note other common mismatches between these platforms.

So, find a friend with a Mac and ask for their help testing.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.