playMaker

Author Topic: Enable Object When in Trigger Zone and mousebutton is pressed.  (Read 1823 times)

Devistute

  • Playmaker Newbie
  • *
  • Posts: 8
Enable Object When in Trigger Zone and mousebutton is pressed.
« on: November 30, 2015, 02:39:59 AM »
So, i need help. I want to enable animation (gameobject) for turning an lever, when player is in triggerzone and presses mouse0. However i couldnt make the playMaker to do so, i had "OnTriggerEnter" on start, but i have no idea of how to implement the mouse press to it..? Do i have to edit the scripts, or is there a way to do this only in playMaker.  ???
My game, "The Reminiscence" which uses playMaker almost in all interaction the game offers!

http://www.indiedb.com/games/the-reminiscence

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Enable Object When in Trigger Zone and mousebutton is pressed.
« Reply #1 on: November 30, 2015, 02:47:33 AM »
Sounds like you are 1/2 there. 

1) Player enters trigger zone
2) Set variable to true.
3) Player clicks mouse
4) Set variable 2 to true
5) Play animation.

So the player clicks the button but must be in the trigger zone.  OntriggerEnter and OntriggerExit can be used to set variable to true or false.


Devistute

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Enable Object When in Trigger Zone and mousebutton is pressed.
« Reply #2 on: November 30, 2015, 02:50:42 AM »
Oh. Well now that you put it that way, it actually makes sense. Thank you!
I will most likely come back to ask more help, since im pretty new with playMaker.

Edit: What type of Variable should i use?
« Last Edit: November 30, 2015, 02:52:18 AM by Devis »
My game, "The Reminiscence" which uses playMaker almost in all interaction the game offers!

http://www.indiedb.com/games/the-reminiscence

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Enable Object When in Trigger Zone and mousebutton is pressed.
« Reply #3 on: November 30, 2015, 10:36:03 AM »
Hi,
i made a quick sample of how to set this up :


the fsm shown is the trigger location