playMaker

Author Topic: Mouse Pick Event fix, or alternative?  (Read 2607 times)

AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Mouse Pick Event fix, or alternative?
« on: February 23, 2022, 07:11:52 PM »
So no matter what I do, the Mouse Pick Event and Mouse Pick actions don't appear to work in my game.

I've looked at old threads and tried the usual fixes:

- Made sure my main camera is tagged MainCamera
- Made sure only ONE camera is tagged MainCamera
- Made sure my target object has a collider in it
- Made sure the raycast reaches far enough (my camera is 100 units away and I've tried 25, 50, 100, 200, 1000...)
- Made sure the object is in the "Cameras" layer and the Event Picks' layer mask is set as 1 - "Cameras."
- Made sure there are no colliders in front of the collider I'm trying to click. I even tried the event with 99% of the game removed so that nothing could possibly get in the way.

My only thoughts are that maybe Mouse Pick Event doesn't work with either Cinemachine cameras, or the New Input System? Both of which I am using in this game.

Anyone have any other solutions?

Otherwise, some alternative way of clicking on a moving 3D object to activate events?
« Last Edit: February 23, 2022, 09:09:52 PM by AbeDieckman »

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Mouse Pick Event Doesn't Work?
« Reply #1 on: February 23, 2022, 08:50:43 PM »
Heya,

Are the items you are trying to click on in the "Camera" layer?  You got a mask on the mouse pick event to only pick those items in this layer so if you are trying to click on something that isn't in the layer, it will get ignored. 

Thanks

AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Mouse Pick Event Doesn't Work?
« Reply #2 on: February 23, 2022, 09:13:15 PM »
Heya,

Are the items you are trying to click on in the "Camera" layer?  You got a mask on the mouse pick event to only pick those items in this layer so if you are trying to click on something that isn't in the layer, it will get ignored. 

Thanks

Hey, yeah, the objects are indeed in the Cameras layer, and yes the object I'm trying to click is in that layer.

It sounds a bit confusing but they are technically camera-icons within the game you are trying to click.

Just to make sure that wasn't a conflict, I did change the object layer to CCTV and point to that layer with Mouse Pick, but it didn't make a difference.
« Last Edit: February 24, 2022, 12:17:09 AM by AbeDieckman »

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Mouse Pick Event fix, or alternative?
« Reply #3 on: February 24, 2022, 12:58:48 AM »
Heya,

Can't really tell without more info on this but are you trying to click on a UI button Icon or the camera itself?  Need to see more to be able to help sorry.

AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Mouse Pick Event fix, or alternative?
« Reply #4 on: February 25, 2022, 12:47:45 AM »
Heya,

Can't really tell without more info on this but are you trying to click on a UI button Icon or the camera itself?  Need to see more to be able to help sorry.

Hi, thanks for asking.

Not working with UI objects or buttons right now. It's a 3d Object, a model of a security camera. It has a box collider in it. It's currently in the "CCTV" layer which is what the Mouse Pick Event mask points to.

It's supposed to change material color when clicked -- as well as some other things, but none of that matters because clicking the object in the simulator or the game window never carries the playmaker event past the Pick Mouse Event part.

In the previous screenshot I had added a simple sprite object over the top of it to make it easier to find on-screen, but I've tried making Mouse Pick events work with and without the sprite, and it doesn't make a difference.

Happy to provide any other details I can. I've included another screenshot that maybe helps? Not sure what else to do -- this really makes Playmaker almost unusable for me.

EDIT: For more clarity, the specific gameobject being mouse picked is the child "Camera_Selector," and although it appears turned off in this screenshot (my bad) it is definitely turned on and visible, with its box collider active, during gameplay.
« Last Edit: February 25, 2022, 12:52:32 AM by AbeDieckman »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Mouse Pick Event fix, or alternative?
« Reply #5 on: February 25, 2022, 08:54:09 AM »
Hi.
If you try on a new scene just with an object an a mouse pick, does it work?

AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Mouse Pick Event fix, or alternative?
« Reply #6 on: February 25, 2022, 09:16:34 PM »
Hi.
If you try on a new scene just with an object an a mouse pick, does it work?

I did try a new scene, and no, unfortunately Mouse Pick still doesn't register any kind of click or hover or anything.

I'm using Unity 2021.1.0f1, for whatever that's worth.

Feeling pretty lost on this. I've been using Playmaker off and on for a few months now and this is the first thing that just... doesn't work. But it's pretty important to what I'm trying to build.  :'(


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Mouse Pick Event fix, or alternative?
« Reply #7 on: February 26, 2022, 11:05:19 AM »
Hi.
i just downloaded the unity version and latest PM version, and it seems to work fine for me :


AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Mouse Pick Event fix, or alternative?
« Reply #8 on: February 26, 2022, 03:29:53 PM »
Hi.
i just downloaded the unity version and latest PM version, and it seems to work fine for me :

Thank you for checking that. I guess I'm stumped, then. I tried recreating your exact setup here -- still no luck.

My guess, then, is that perhaps mouse events like this aren't compatible with the New Input System? That's all I can think of. Sadly I can't uninstall it, apparently, without creating a huge array of errors.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Mouse Pick Event fix, or alternative?
« Reply #9 on: February 26, 2022, 06:18:11 PM »
HI.
I installed the new input system and its still working for me.

AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Mouse Pick Event fix, or alternative?
« Reply #10 on: February 26, 2022, 06:38:59 PM »
HI.
I installed the new input system and its still working for me.

Hi, thanks again for putting effort into looking through this.

Any other suggestions you have would be more than welcome. Otherwise, well I dunno.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Mouse Pick Event fix, or alternative?
« Reply #11 on: February 26, 2022, 06:47:07 PM »
Hi.
Maybe try creating a new project to test if you can get it to work with just a cube, and some mouse pick events like on my sample.
Add Playmaker and the new input system then do test.
if it works, then setup some input actions
and see if it breaks at some point.

AbeDieckman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Mouse Pick Event fix, or alternative?
« Reply #12 on: February 26, 2022, 06:54:24 PM »
Hi.
i just downloaded the unity version and latest PM version, and it seems to work fine for me :


Also, just so you don't think I'm completely crazy, here's a gif.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Mouse Pick Event fix, or alternative?
« Reply #13 on: February 26, 2022, 07:22:20 PM »
Hi.
Can you show :
Project Settings/Input Manage
Project Settings/Input System Package
Project Settings/Player

or if you can share the projects pm me a link