playMaker

Author Topic: Input Broker  (Read 4719 times)

Graham

  • Sr. Member
  • ****
  • Posts: 340
  • I Love Playmaker!
    • Portfolio
Input Broker
« on: March 16, 2015, 04:26:56 PM »
I read this Unity Answer by Jean Fabre: http://answers.unity3d.com/questions/28473/simulating-key-presses.html

Can this functionality be made into an action for simulating key presses?
« Last Edit: March 16, 2015, 04:50:07 PM by Graham »
More templates on the Unity Asset Store!

Disclosure: We are using affiliate links to our assets; we may receive a commission for purchases made through them. This helps us to continue developing and maintaining great products!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Input Broker
« Reply #1 on: March 18, 2015, 05:16:34 AM »
Hi,

 Unfortunatly, that would mean editing the official actions ( for portability), so within Playmaker, I do it differently, because of PlayMaker nature.

 basically, you create your own input broker by having your fsm not rely on the unity  set of input function but yours. and everytime you want to listen to a key press you listen to both the keypress AND a custom keypress flag that you can raise from another fsm.

 so if an fsm wants to do something on  y key press, it should not itself try to catch this keypress, but you should create a fsm that manage inputs and fire a global event "MY KEY PRESSED", that fsm will catch, and so these fsm don't care how ti was triggered, and you can fake keypress very easily then.
 
Does that make sense?

Bye,

 Jean

Graham

  • Sr. Member
  • ****
  • Posts: 340
  • I Love Playmaker!
    • Portfolio
Re: Input Broker
« Reply #2 on: March 18, 2015, 01:40:16 PM »
Thanks for the info Jean. I was hoping for the actual simulated key press so that it would work with unity's input manager and not require a workaround to get the horizontal easing that is built in, and not need two sets of logic. However I am going another route, and it was not as tedious as I had worried it would be.
More templates on the Unity Asset Store!

Disclosure: We are using affiliate links to our assets; we may receive a commission for purchases made through them. This helps us to continue developing and maintaining great products!