playMaker

Author Topic: Using Mouse Pick  (Read 18545 times)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Using Mouse Pick
« on: April 22, 2011, 03:14:00 AM »
Video tutorial showing how to use Mouse Pick: (720p recommended):


Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Using Mouse Pick
« Reply #1 on: January 12, 2012, 07:33:11 AM »
Hey~

I implemented this to a character and, was curious as to how one would make the character move over a terrain for instance instead of just walking through it? (the character stays on one level ;<)

Thanks in advance

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: Using Mouse Pick
« Reply #2 on: January 13, 2012, 07:08:41 AM »
I had this same question a while ago when I first tried this tutorial, never got it working. But since then I've figured out more and more about Playmaker and now I have a way.

First, put a Character Controller on the character. Very important.

Then you want to use Controller Simple Move instead of Move Towards. And set it to move at maybe 50 Speed with 1 in Z and set to local space. This should move it forward in which ever direction it's pointing. And because of the Smooth Look At, it's forward direction is set towards the target sphere. And it should go up over obstacles (less than the characters slope limit allows)

But now that you're not using the Move Towards, you don't have a Finish Distance. To make up for that try adding a sphere collider to the target sphere and setting it to Trigger. Then add a new FSM to that which, when it gets a Trigger Enter event (Character colliding with it) will send a To Stop event to the Character. Which triggers the Global Transition to bring it back to the Idle State.

Hopefully the pictures will help explain. The first image is the new Target Sphere FSM and the second image is the modified Character FSM.
« Last Edit: January 13, 2012, 07:10:39 AM by FractalCore »

Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Using Mouse Pick
« Reply #3 on: January 27, 2012, 04:57:45 AM »
Thanks~ :D


mr.erix1

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Using Mouse Pick
« Reply #4 on: March 26, 2012, 02:58:10 AM »
hi! i fallow to this tutorial and i can't find "broadcast event"  please help!
i hawe latest playmaker update.     



Uploaded with ImageShack.us

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Using Mouse Pick
« Reply #5 on: March 26, 2012, 08:06:16 AM »
Broadcast Event Is now an option in the Send Event action under Event Target. You will also need to set any event you want to broadcast to be a global event by checking the checkbox next to its name.

mr.erix1

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Using Mouse Pick
« Reply #6 on: March 26, 2012, 08:48:40 AM »
than you werry much for your help:)

vaios76

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Using Mouse Pick
« Reply #7 on: February 10, 2013, 06:41:17 AM »
I picked playmaker for unity3d from the asset store  a couple of months ago and decided to use it this weekend. I watched the mouse pick tutorial and tested it successfully in a scene with a simple plane and two cubes with one of them as target. I decided to test on a terrain made from a heightmap in a unity scene (2048X25X2048) and I failed. What may be the reason? Thanks in advance.

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Using Mouse Pick
« Reply #8 on: February 10, 2013, 06:46:59 AM »
mouse pick and screen pick are fancy versions of raycasts. Raycasts can only collide with colliders (duh :D). Make sure your terrain has one. If that doesn't work, turn the distance setting in the action to something very high and see if that helps.
Best,
Sven

vaios76

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Using Mouse Pick
« Reply #9 on: February 10, 2013, 10:52:40 AM »
the terrain collider is on allright. Mouse pick works on a plane but I can't make it work on a unity terrain. I have set the distance very high (>5000) but nothing happens. I am using Unity 4.01 if that means something.

stevenuncle

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Using Mouse Pick
« Reply #10 on: February 11, 2013, 09:35:36 AM »
Thanks~