playMaker

Author Topic: Mouse Pick Event Problem [SOLVED]  (Read 2944 times)

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Mouse Pick Event Problem [SOLVED]
« on: April 20, 2016, 01:43:23 PM »
I have a 3D model of a gate valve with some pipes that are attached to the valve.  The valve has a handle on top.

I have a button in the UI that will activate/de-activate the pipes that are attached to the valve.

I have a Mouse Send Event setup such that when the user clicks the mouse on the valve handle... the valve open animation plays.

This works fine when the 'pipes' gameobject is hidden (de-activated)... but when the 'pipes' are visible (activated), the mouse picking of the valve handle no longer works.  (The 'pipes' gameobject is not near the handle and it does not obscure the handle visibly).

If I hide the 'pipes' gameobject again... then the mouse pick of the valve handle works and the animation plays.

Any idea why having the 'pipes' gameobject visible should break the mouse pick on the valve handle??

Thanks!
« Last Edit: April 20, 2016, 05:45:19 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Mouse Pick Event Problem
« Reply #1 on: April 20, 2016, 03:12:43 PM »
Try putting an FSM on the pipes and see if it's getting mouse events.
Sometimes the collisions in Unity aren't where they look like they should be...

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Re: Mouse Pick Event Problem
« Reply #2 on: April 20, 2016, 04:06:46 PM »
I got it sorted by adding a layer mask to the Mouse Pick Event.  The objects are on the Default layer and when the layer mask slot was showing 0... I thought that meant the Default Layer (layer 0) was already chosen.

When I plugged in a 1 and then got the Element 0 slot with the Default layer listed... I knew I was an idiot.  It's working fine now.

Thanks!

Skorpiuz

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Mouse Pick Event Problem [SOLVED #2]
« Reply #3 on: July 25, 2018, 03:36:51 PM »
I know you already found a solution, but I want to report my own problem/solution.

I recently add a camera to do screenshots and immediately MOUSE PICK EVENT stop working... because that new camera was tagged as Main Camera. Remove the tagg leaving only the original camera as main and problem solved.