playMaker

Author Topic: Get Mouse Down & Store Result, MOUSEDOWN event [SOLVED]  (Read 3452 times)

Macguffin

  • Playmaker Newbie
  • *
  • Posts: 2
Get Mouse Down & Store Result, MOUSEDOWN event [SOLVED]
« on: September 14, 2012, 01:49:50 PM »
Hey folks,

I'm new to Playmaker, and wanted to see if there was an underlying reason for a couple things I ran into.

- The MOUSEDOWN event seems to only refer to a MOUSEDOWN on the object it is on.  Is there some other hardwired event for a mouse button being pressed in general?  In this case, I'm trying to capture a mouse down in order to send the location to an object, and have it move in that direction.

- The Get Mouse Down action has a Store Result field, but it only contains a "None" value in its pulldown, for me.  I've got a Vector3 in variables.  Am I missing something here?

Thanks!
« Last Edit: September 15, 2012, 11:14:59 AM by Macguffin »

cdillard

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Get Mouse Down & Store Result, MOUSEDOWN event
« Reply #1 on: September 14, 2012, 07:35:37 PM »
Put this on what you want to move.

You should start out with a state that waits for on mouse down.

Make a variable that is a Vector3

Make another state that has a mouse pick event.

In the mouse pick, store the point as your V3 variable.

Next, move Owner to that target position with Move Towards.


Macguffin

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Get Mouse Down & Store Result, MOUSEDOWN event
« Reply #2 on: September 15, 2012, 11:13:28 AM »
Thanks for the reply.  I did actually have it working, but was more specifically curious why the Get Mouse Button Down event won't let me use Store Result to put the result into a Vector3. 

In writing this post, I realized this is because Get Mouse Button Down is returning a bool, not the Vector3 of the mouse position.

Because my game is 2d, I was saving Get Mouse X and Get Mouse Y to a pair of floats, and then piping them into the movement action.