playMaker

Author Topic: Click a chest lock to unlock it  (Read 1230 times)

GuinUK

  • Playmaker Newbie
  • *
  • Posts: 6
Click a chest lock to unlock it
« on: June 28, 2017, 04:57:20 PM »
Hi guys,

I know this will be easy, but after watching 20 vids and reading too many 'almost' useful pages I decided to bite the bullet and ask.

I have a box collider on the chest on the 'lock'
I have set it as a trigger

This works to an extent but allows you to just walk into it and I ideally want it to click.

I have also tried a button down but think I cocked it up.

Thanks in advance for any help.
Guin

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Click a chest lock to unlock it
« Reply #1 on: June 29, 2017, 02:20:02 AM »
Hi, if the fsm is on the chest you can use a 'System Event' transition.
Right click on a state, select 'add transition' or 'add global transition' and then 'system event'
There you will find 'Get Mouse Down'

after you placed this you can click on the object while playing and the Transition will be triggered.

There is also an action called 'Get Mouse Button Down' but this one will trigger on the whole screen, no matter where you click.

This one can be useful with a mouse pick event especially when you have lots of objects, because if you would have a lot of objects with the System Event it will get laggy.

here is a sample video :


GuinUK

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Click a chest lock to unlock it
« Reply #2 on: June 30, 2017, 03:30:31 PM »
Thank you :)
Much appreciated