playMaker

Author Topic: ActionHelpers.MousePick returning null (When I don't think it should) [SOLVED]  (Read 2434 times)

JinAsunaru

  • Playmaker Newbie
  • *
  • Posts: 2
Newbie here, worked in Unity for a while but still new to everything Playmaker does. So here's my problem.

I am using a simple FSM that first checks when Left Mouse button up is sent, then uses Mouse Pick to check if the user clicked an object and if it succeeds it continues the FSM and sets up more data.

The scene is set up like a quiz where you answer a question then go to the next question. In this case you are picking the correct image out of 2 images. The Mouse Pick and selection works fine until I get to the last question. I can click one of the images and it behaves as expected but after that, when I click the other image or the same one, the ActionHelpers.MousePick function fails to pick up on the fact that I'm clicking a valid object.

Is there some flag or something that can affect ActionHelpers.MousePick that users aren't normally informed of? I know about the Main Camera flag, and the objects I'm clicking aren't being changed once they are clicked on.

Any help, insight, or even educated guesses would be greatly appreciated.
« Last Edit: May 15, 2014, 05:36:28 PM by Alex Chouls »

JinAsunaru

  • Playmaker Newbie
  • *
  • Posts: 2
Alright, so a co-worker has figured out the issue since he also ran into the same problem. It has since been solved.

In case someone else comes across this, the problem was that we had multiple cameras in our scene. Both of them were tagged as MainCamera. It seemed that at the end of the quiz, the second camera was being re-enabled too soon and playmaker was mouse picking from that camera instead of the one we wanted.

So it's simple. Manage your Main Cameras correctly so no more than one are active at a time. :D

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Official Playmaker Support
    • LinkedIn
Thanks for posting the solution :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15622
  • Official Playmaker Support
Hi,

 It's critical that only one camera is tagged "Main Camera". Other  ( if not most) assets that rely on this tag will have bugs with this situation.

Bye,

 Jean