- Home /
Toggle Boolean with 360 Controller Face Buttons
I am working on a RPG 3rd person controller that will work with the Xbox360 Controller. I want to assign the four available spells to the four face buttons of the controller.
Currently I have it so when you press the "a" button, the move assigned to button "a" will become active. However I need it to work where pressing "a" once will activate the move (until you cats it using RT) and pressing it again will turn it off.
Any thoughts? Thanks.
Answer by AlexJBoyd · Oct 04, 2013 at 04:36 PM
Thank you for the response, but I actually just solved the problem myself.
Every time I press a button I call a method and pass an int with it. Inside that method I turn all the button booleans to false, then run a switch statement using the int passed in and turn the appropriate one on.
Answer by GamesMaxed · Oct 04, 2013 at 04:51 PM
This should work if(Input.GetButtonDown("ButtonName"){ bool = !bool }
Answer by Grim_Darknight · Oct 04, 2013 at 04:31 PM
if("button")
{
value = !value;
}
drop in the portion of code that makes the move active and I can plug this in with actual variables.
Your answer
Follow this Question
Related Questions
XBox Controller Right Axis Angle 0 Answers
Trouble with the xbox controller on Mac 0 Answers
Using an Xbox controller with GUI buttons 0 Answers
Controller Supported UI 0 Answers