playMaker

Author Topic: GameObject->UI->Button and touch  (Read 4478 times)

krysber

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
GameObject->UI->Button and touch
« on: October 21, 2015, 01:22:38 AM »
I'm using Unity 4.6.1f1 and Playmaker 1.7.7.f6 and am trying to create a touchable button. I can create an empty object and add a GUITexture component to it and get touch working, but not buttons. They register the touch, but the FSMs don't start...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4586
    • View Profile
    • jinxtergames
Re: GameObject->UI->Button and touch
« Reply #1 on: October 21, 2015, 10:23:13 AM »
Hi,
if you mean the Ugui Button,
then you need to get the Ugui Package on the EcoSystem

Then you need to add the Component "PlayMakerUGuiComponentProxy"

Then on that Component (if the fsm is on a different object) you need to set the target

Then you can use the build in event transitions (right click on state and select "add transition/Custom Events/Ugui)

Or you can use your own transition name and on the Component click on "Edit" and replace the transition name.

krysber

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: GameObject->UI->Button and touch
« Reply #2 on: October 23, 2015, 01:23:15 PM »
I'm not finding the "PlayMakerUGuiComponentProxy" component under neither Component nor PlayMaker in the menu in Unity after adding all items in Playmaker Ecosystem packages.

krysber

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: GameObject->UI->Button and touch
« Reply #3 on: October 23, 2015, 01:36:09 PM »
then you need to get the Ugui Package on the EcoSystem

Sorry, misread this as needing to just install EcoSystem...



Will update once I do this...

krysber

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: GameObject->UI->Button and touch
« Reply #4 on: October 25, 2015, 04:22:44 PM »
I have done this but get error:

Code: [Select]
Missing 'PlayMaker UGui' prefab in scene
UnityEngine.Debug:LogError(Object)
PlayMakerUGuiComponentProxy:FirePlayMakerEvent(FsmEventData) (at Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs:461)
PlayMakerUGuiComponentProxy:OnClick() (at Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs:320)
UnityEngine.EventSystems.EventSystem:Update()

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4586
    • View Profile
    • jinxtergames
Re: GameObject->UI->Button and touch
« Reply #5 on: October 25, 2015, 11:22:13 PM »
Hi,
go to the Playmaker uGui folder.
Then Prefabs folder and drag the prefab into your scene :)

krysber

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: GameObject->UI->Button and touch
« Reply #6 on: October 27, 2015, 08:26:01 AM »
I am getting two errors after importing UGUI now...

Error 1
Code: [Select]
Assets/PlayMaker Custom Actions/uGui/EventSystem/GetLastPointerEventData.cs(221,96): error CS1061: Type `UnityEngine.EventSystems.RaycastResult' does not contain a definition for `worldNormal' and no extension method `worldNormal' of type `UnityEngine.EventSystems.RaycastResult' could be found (are you missing a using directive or an assembly reference?)

Error 2
Code: [Select]
Assets/PlayMaker Custom Actions/uGui/EventSystem/GetLastPointerEventData.cs(226,98): error CS1061: Type `UnityEngine.EventSystems.RaycastResult' does not contain a definition for `worldPosition' and no extension method `worldPosition' of type `UnityEngine.EventSystems.RaycastResult' could be found (are you missing a using directive or an assembly reference?)

I have tried re-importing the offensive script after deleting it from Assets, but the error persists.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4586
    • View Profile
    • jinxtergames
Re: GameObject->UI->Button and touch
« Reply #7 on: October 27, 2015, 02:08:14 PM »
Hi,
you could try updating playmaker.
I am on pm 1.7.8.3 but i am not sure if that is the problem but it might be.

krysber

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: GameObject->UI->Button and touch
« Reply #8 on: October 28, 2015, 10:20:29 AM »
I switched to Unity 5 and Playmaker 1.7.8.3 and it works! Thanks for your help djaydino.