- Home /
Using UI Button to trigger button down??
Hello, I'm using Unity to create a 2D top-down RPG for Android. I'm using CrossPlatformInput included with Unity Standard Assets I downloaded from the Asset Store. I've been trying to create controls for my player. 1 directional pad made up of 4 buttons to allow the player to move and 1 button that will act as an action button. I've got the directional pad working perfectly. It's the action button I'm having trouble with.
I have a game object called "Controls". Components -> Rect Transform -> Canvas -> Graphic Raycaster (script) -> Mobile Control Rig (script)
I have my UI button called "ButtonA". Components -> Rect Transform -> Canvas Renderer -> Image (script) -> Button (script) -> Button Handler (script) name is set to "Fire1" -> Evernt Trigger (script) added Pointer Down ButtonHandler.SetDownState added Pointer Up ButtonHandler.SetUpState
Now I have Fire1 set as E in my project settings and I can walk up to my sign, hit E and it works, but I still can't get it to work with the button. My script is looking for "Input.GetButtonDown("Fire1")" to be true. What am I doing wrong?