I am having issues with a lot of the Assets I am downloading. I do not want to give them a bad review, if it is my mistake.
Many times, when they say Click Anywhere to move your Unit, my Unit just deselects.
And if they say Right-click to move unit, I would normally use Ctrl-Click or Command-Click to do the same thing, but … again… it just deselects, or does nothing at all.
Is there a setting in Unity to use the MackBook TrackPad clicks, or do have to buy a USB Mouse to use Unity?
Please help, this is getting frustrating, and expensive.
For those of you who like to do your programing on a Mac lapTop, Unity may not be the best solution.
The Unity Software uses all the standard Key clicks that you are used to when using mac, or LapTops,
but several (most) of the developers of the assets you will run into, seem to either not take Mac into
account, or restrict it on purpose (not sure why they would do this).
Mac uses a single button mouse.
PC uses 2-8 button mouse, with most using 3.
Mac adapts to this with Ctrl-Click. Ctrl-Click serves the same purpose as Right-Click on a PC mouse.
99.99% of software ported to Mac, uses this solution.
I have downloaded several (over 10) assets from the Unity Asset Store, and had most fail on my
lapTop (MacBook Pro), due to non-responsive clicks.
The assets allow me to Click on something, but when it requires a Right-Click, the standard Ctrl-Click
(you would use on Mac), is not accepted.
To get around this, you need to mess with the Input Receiver Scripts that come with the asset.
There are several on the assets store, and (so far) not one is just drag-and-drop.
All require you to edit the script so that it will work for whatever asset you want to use.
This gets VERY frustrating when downloading multiple assets, to figure out which works best for your
needs. When just fighting the Click, I never get to see the full functionality of what their asset can do.
The simple work-around (not so simple), is to use a 2+ button USB mouse.
But… this kills the idea of working on a lapTop. You now need to carry around a mouse, and have a surface
you can use it on.
In Unity’s top menu: Edit->Project Settings->Input
In the input Manager you can change settings for each “action”.
There is a Positive Button and an Alt Positive button. Both of these can be use independently.
"Fire 1” Positive Button is set to "left ctrl”.
"Fire 1” Alt Positive Button is set to “mouse 0” <—— left mouse click…
So if you hit the left control key OR use the trackPad/Left-Mouse-Button, this will activate Fire 1. I can not find a way to have multiple buttons in this list.
For instance, I can not set "Fire 1” Positive Button to "left ctrl + mouse 0”
Can not find any documentation on this.
In whatever input script you have for your game, find a line that looks like this:
And change it to:
This will make it use whatever button you assigned in the inputManager calls the action.
In that same script, replace the line of code
if (Input.GetKey(“left ctrl”) && Input.GetMouseButtonDown(0))
This will make it so you must use the Left Control Click AND the trackPad/Left-Mouse-Button.
This will make it so every mac user can continue to use the asset as normal, where
Ctrl-click is the same a s Right-MouseButton click.
If you want to get fancy, and tend to use Mac and PC for doing your programing…
if (Input.GetKey(“left ctrl”) && Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1))
The || is the same as an OR statement.
Of course, later, when you port over to your mobile device, you’ll have to create those inputs,
but that will be later, after you tested your assets, and know what you want your game to do.
Hope this helps.
If anyone knows how to put multiple key combinations in the input manager, please let me know.