playMaker

Author Topic: Help with UI buttons[SOLVED]  (Read 1191 times)

FunD

  • Playmaker Newbie
  • *
  • Posts: 29
Help with UI buttons[SOLVED]
« on: February 11, 2019, 07:00:18 AM »
Hi,

I just started working on a new game, using Playmaker. I'm experiencing a strange bug, regarding UI buttons.

I created UI buttons in Unity and used playmaker, to make the Scenes change, after clicking with the mouse on a button. I added an event on 'State 1', named it 'Load Scene' and added a 'Get Key Down' state, selected 'Mouse 0' as Key.

Then I linked this to a second State, that has the state 'Load Scene', and entered the scene name. Also, all scenes are added into Unity's 'Build Settings'.

The thing is that this actually works, but only when there's 1 button in a scene.

..So right now I'm having issues with the title screen of my game, because it has 3 buttons ('credits', 'controls', and 'play') and for some reason, they all go to the 'credits' scene, when clicked on. I can't figure out why.
The 'Scene By Name' in the Playmaker State are named correctly, I even tried creating a completely new button and starting from scratch, but it will always go to the 'credits' scene.

Help please?
Here are some screenshots, also:
https://ibb.co/jGhnL3c
https://ibb.co/fpKR0Ty
https://ibb.co/Qmp0kVP
https://ibb.co/dg1QKYm
« Last Edit: February 13, 2019, 08:35:43 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: UI buttons bug?
« Reply #1 on: February 11, 2019, 08:22:15 AM »
Hi.
The 'get key down' will get the mouse 0 pressed, no matter where you click.

You need to use "Ui Button On Click Event"

on 'game object' place the object with the Ui button

FunD

  • Playmaker Newbie
  • *
  • Posts: 29
Re: Help with UI buttons
« Reply #2 on: February 11, 2019, 08:59:44 AM »
Oh, I see! Thank you.  :D