- Home /
OnMouseDown with 360 controller unity?
Hi,
Im probing for information regarding setting up my 360 controller.
I need to modify my existing code to work with a controller instead of mouse and key-board. Unfortunately, the game its self was setup with the direct intention of being controlled with the mouse and keyboard, and im not sure how i can transfer these commands to be 360 based.
The functions i am unsure of are -
function OnMouseEnter()
function OnMouseExit()
function OnMouseDown()
Is there anything that i can use with maybe a crosshair controlled by the 5th/4th axis stick instead ?
Any help or knowledge in this area would really be appreciated.
Thanks, - Graeme.
Answer by Jean-Fabre · Apr 19, 2011 at 10:33 AM
Hi,
you can certainly have a guiTexture ( or anything really that fit your needs) that represent the crosshair and move it "on screen" using the joystick axis, and cast a ray to find what's beneath to emulate the mouse.
but as far as emulating the mouse, I think you'll have to roll your own system or better: use an existing framework that allow you to that, ( EZGUI will cover a lot of ground on that regard). Watch the video on that site, you'll see it covers a lot of possibilities regard alternative input.
In all cases, you'll likely have a lot of re factoring as well, moving content within OnMouseEnter() and the like into specific function and have it called either within the OnMouseEnter, or from another function that would it self be triggered by your mouse emulator.
Bye,
Jean
Ace, thankyou so much $$anonymous$$! =)
i didnt have a clue where to start with this before.