playMaker

Author Topic: Mouse Pick Event equivalent for Gamepad? [SOLVED]  (Read 2242 times)

Beefdoctor

  • Playmaker Newbie
  • *
  • Posts: 13
Mouse Pick Event equivalent for Gamepad? [SOLVED]
« on: June 17, 2015, 05:19:49 AM »
Hi! I am a 3D graphic artist of 5 years and have just started looking into game development, i'm a total noob so please be gentle.

I've setup an FSM on a door which has a start state with a Mouse Pick Event on it, it has a ray distance of one so you have to be close enough to the door to open it, and the Mouse down triggers the next state which is an I Tween Rotate to which opens the door. This is done in reverse to close the door.

When i run the game everything works as expected when i use a mouse but if i use a gamepad, Nothing. I gather this is because Mouse pick event is looking for a mouse click, so my question, can i do the same thing for a gamepad button press?

cheers  :D
« Last Edit: June 17, 2015, 06:50:41 AM by Beefdoctor »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Mouse Pick Event equivalent for Gamepad?
« Reply #1 on: June 17, 2015, 05:53:33 AM »
check get key actions

they have joystick buttons you can select.

i don't know what is you setup,
but if you have a "player going to the door" you might have to set a trigger box in front of the door, so when you are inside that trigger box when you press the gamepad button the door will open.
« Last Edit: June 17, 2015, 06:16:36 AM by djaydino »

Beefdoctor

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Mouse Pick Event equivalent for Gamepad?
« Reply #2 on: June 17, 2015, 06:18:55 AM »
I was hoping to use something similar to Mouse pick event because it uses a ray (and ray distance), mainly because the button i'm going to use to open doors will do other stuff too, like an 'Action' button , so say i press that button to pick up an item and i'm inside the trigger box for a door, the door will open along with picking up the item, and that's not what i want. Any thoughts?

cheers
« Last Edit: June 17, 2015, 06:35:36 AM by Beefdoctor »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Mouse Pick Event equivalent for Gamepad?
« Reply #3 on: June 17, 2015, 06:38:00 AM »

there are different way you can do this,

you can use a different button to open the door,

you can set your button to check first if there is an object.

and if so pickup the item and go back to the state with your button
This Tutorial may help you out how to use triggers.

if you want to use a ray you will have to setup a raycast that is triggered when pressing the gamepad button

Beefdoctor

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Mouse Pick Event equivalent for Gamepad?
« Reply #4 on: June 17, 2015, 06:45:11 AM »
Thanks, you've been a big help, i'll check out that tutorial, and i'll probably dive into raycasts a bit more, i get the feeling that casting a ray is going be easy, it's using the rays collision info that's going to be the pain in the arse lol

cheers