playMaker

Author Topic: Click off of object to trigger MOUSE DOWN?[SOLVED]  (Read 780 times)

spengrantest

  • Playmaker Newbie
  • *
  • Posts: 4
Click off of object to trigger MOUSE DOWN?[SOLVED]
« on: August 25, 2020, 09:27:41 AM »
Evening everyone, brand new to playmaker here, trying to use it to quickly prototype some mechanics to see if they're worth investing the time into and ran into a bit of a large snag.
My specific goal is to have it so when I hold right-click, the camera zooms in to a behind the shoulder view of my character, however, I can't seem to find a way to make it so I can click the mouse anywhere within the game window to trigger the view. Been reading through the documentation, lots of googling and tutorial watching and I haven't found anything addressing this specific situation. I feel a bit silly asking such a beginner level question, but how would you all solve this issue, as I am totally lost.
« Last Edit: August 27, 2020, 02:14:05 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Click off of object to trigger MOUSE DOWN?
« Reply #1 on: August 25, 2020, 10:08:35 AM »
Hi.

something like this :

Fsm 1 (mouse Listener) :

State 1 :
'Get Mouse Button Down' and connect to state 2
'Send event by name' send event to fsm 2 "Zoom In"

State 2 :
'Get Mouse Button Up' and connect to state 1
'Send event by name' send event to fsm 2 "Zoom Out"

Fsm 2 (Zoom)

Start state not used

State 2 :
have a global transition on this to receive the event "Zoom In"
Do zoom stuff

State 3 :
have a global transition on this to receive the event "Zoom Out"
Do zoom stuff


To zoom depends on how you want to do this, but you could for example tween a float with Playmaker Tween Float
and use the variable on a 'Set Scale' action (don't forget to enable Every Frame)

spengrantest

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Click off of object to trigger MOUSE DOWN?
« Reply #2 on: August 25, 2020, 10:52:14 AM »
Thank you so much, that worked beautifully! Apologies again for the relatively low level question, and good luck on your game! ^^

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Click off of object to trigger MOUSE DOWN?
« Reply #3 on: August 25, 2020, 03:32:32 PM »
Hi.
No Problem  :D
Feel free to ask, even you think its low level.

Also please don't lock your threads you can just edit your first post and add [SOLVED] to the subject.

This way other people who found a subject can reply on it (for example if they would have a similar issue and could not solve it)