Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: poppichicken on October 11, 2012, 07:15:55 PM

Title: GetMouseButtonDown - strange error
Post by: poppichicken on October 11, 2012, 07:15:55 PM
Hi everyone.

I'm still very early into my journey with Playmaker, so a lot of simple things are confusing me.
I have a little problem which may be trivial to solve, but it's got me stuck.

I've got a VERY basic scene, with only a Main Camera, and a PlayMakerGUI.
I've got an FSM attached to the main camera, and it only contains one state, called waitForMouseButtonDown.
That state only contains one action: GetMouseButtonDown. It is sending MOUSE DOWN when the Left button is clicked.
I don't have a transition target state, as I wanted to sort out an error before moving on.

I have the following error:
Main Camera : FSM : waitForMouseButtonDown
Owner needs a Collider or GUI Element to respond to mouse events!

Can someone offer any tips or suggestions?
I don't know why I'd need a collider or gui element on the main camera in order to process mouse clicks.
I haven't found any documentation that would suggest that it is required.

Thanks.
Title: Re: GetMouseButtonDown - strange error
Post by: kiriri on October 12, 2012, 07:56:15 AM
you do not need a collider to detect if a key has been pressed. Are you sure you used Get Mouse Button Down and not Mouse Pick Event as mouse down? Mouse pick event performs a raycast check on a specific gameObject and raycasts require Colliders.
Title: Re: GetMouseButtonDown - strange error
Post by: poppichicken on October 12, 2012, 04:55:37 PM
I'm pretty certain that I used Get Mouse Button Down, but I'll double check to be sure.

[EDIT] Yes, I was using GetMouseButtonDown.
However, when I removed action, and even after removing the state, the error remained!
It's very possible that I had a MousePick action earlier on that I removed, but the error didn't get cleared.

When I removed the FSM from the main camera, the error finally went away.
I've now added a new FSM, and GetMouseButtonDown to the starting state, and the error has not reappeared.