playMaker

Author Topic: Activate GUI button when clicked (not released)  (Read 2939 times)

WelchComp

  • Playmaker Newbie
  • *
  • Posts: 3
Activate GUI button when clicked (not released)
« on: October 11, 2014, 08:33:45 PM »
I have a playmaker GUIbutton in my Unity scene and I want it to send an event the moment I click on it instead of when the GUIbutton is released. I need this because users could (and likely will) drag the mouse off of the GUIbutton before releasing their mouse button. When doing this action the event is never sent.

Is there any way I can accomplish this?
« Last Edit: October 11, 2014, 08:35:36 PM by WelchComp »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Activate GUI button when clicked (not released)
« Reply #1 on: October 12, 2014, 01:19:05 PM »
Are you using legacy gui or ugui?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

WelchComp

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Activate GUI button when clicked (not released)
« Reply #2 on: October 14, 2014, 12:58:30 AM »
Im not sure how to tell. I'm using Playmakers UI action scripts and the one I selected is called "GUI button". and it's stored under a category called "GUI"

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Activate GUI button when clicked (not released)
« Reply #3 on: October 14, 2014, 07:19:51 AM »
Legacy GUI.

So as far as I know there is a way to do this in Unity, but there isnt an action for it. With Legacy GUI they use two separate button types to handle this situation, they're Button and RepeatButton.

Button returns a bool true when the click is released. RepeatButton returns true every frame that it is depressed. There is only an action for Button right now for Legacy.

On the other hand in 4.6 I'm pretty certain that I recall seeing this functionality built into the button system for the new uGui. Someone please correct me here if I'm wrong.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D