playMaker

Author Topic: Mouse Pick Debugging Help  (Read 1820 times)

MarkD

  • Full Member
  • ***
  • Posts: 113
Mouse Pick Debugging Help
« on: April 27, 2014, 12:28:55 PM »
Hey guys,

In my scene I'm tying to use Mouse Pick to select my players target.  The implementation is super easy and quick, but it doesn't work for me.

Here's what I've got:
FSM 1:  Get Mouse Button Down
FSM 2:  Mouse Pick, Save object as a game object variable "myTarget"

When I run the level and I click I can see the FSM running correctly but nothing is being saved as the target.

So, I tried the same thing with a completely clean level with a few test objects and it worked perfectly the first try.

I have no idea how to debug this - any ideas or suggestions?


MarkD

  • Full Member
  • ***
  • Posts: 113
Re: Mouse Pick Debugging Help
« Reply #1 on: April 27, 2014, 01:19:53 PM »
Another piece of the puzzle - I went back to my basic set up scene that worked perfectly and added my player prefab.  In this really simple environment I initially had similar results - aka nothing being saved as a game object.

But after a few hundred clicks it worked!  I found that if I moved the camera around it worked.. slightly.  Where/what I clicked on wasn't always accurate but I could get it to save objects which makes me believe it's got something to do with the position of my camera.

Any thoughts on this or advice?  I'm going to keep fiddling with my camera and a few other ideas to see if I can get better results in the meantime.

MarkD

  • Full Member
  • ***
  • Posts: 113
Re: Mouse Pick Debugging Help
« Reply #2 on: April 27, 2014, 01:26:07 PM »
Ok - here's something (bug?) that really should be documented somewhere.

Apprently Playmaer mousepick only works with a camera TAGGED as Main Camera. 

I googled troubleshooting mouse pick Unity and found a post in the Unity forums where another Playmaker user discovered this.

Tagged my camera as Main Camera and worked perfectly.