Is there a variable in buttons saying if its (not only when it starts) being clicked?
thanks
Is there a variable in buttons saying if its (not only when it starts) being clicked?
thanks
Get Key Up only fires when the user stops pressing the key. If that helps. Not sure what you’re asking otherwise
KeyCode mouseClickL = KeyCode.Mouse0;
Input.GetKeyUp(Options.mouseClickR)
I don’t know what you’re asking. Sorry.
Is there a variable in UI buttons that tells you if the button is being pressed? Not only if the press started or ended.
Did you added Button in Inspector > add component > button
Now in play when you click said item it will show you Pressed visual But nothing will happen further than that unless you use code
My question is how do i do that code you said at the end of the sentence?
Is there a variable in UI buttons that tells you if the button is being pressed? Not only if the press started or ended.
Not unless you can see it in here. Sorry. I think it just fires on click. You would have to script something using an IClickHandler.
What’s an IClickHandler?
I suggest watching some button functionality related videos on youtube . You need code to work for functionality . And attach that code to button
here
Buttons
Basically, it’s a way to tell a Unity script you would like it to listen for mouse clicks and then do something about it. My recommendation is to:
Is that something you can work out do you think?
Is it like this?
Button button;
bool isClick;
void Start()
{
button = GetComponent<Button>();
}
void OnPointerEnter()
{
isClick = true;
}
void OnPointerExit()
{
isClick = false;
}
void Update()
{
if (Input.GetMouseButton(0) && isClick)
{
//do things
}
}
Is it like that??
YAY I GOT IT TO WORK
thanks to that video
That’s really good work.
I’m glad you managed to do it, and I hope it helps your game.