playMaker

Author Topic: [SOLVED] Mouse Pick event not picking up any game objects  (Read 4069 times)

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • Disastercake
[SOLVED] Mouse Pick event not picking up any game objects
« on: May 07, 2012, 01:08:44 AM »
I'm having an issue with the mouse pick event not picking up a game object.  I just tried to reproduce the scene from the tutorials.

Here is a zip of my project:
[DELETED - PLEASE DON'T POST ZIPS OR UNITYPACKAGES THAT INCLUDE PLAYMAKER!]

If you open an info log, launch the game, then try to click on anything, will you see there is no game object being registered.

Any help would be appreciated. =)
« Last Edit: May 08, 2012, 12:47:05 AM by Alex Chouls »
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Mouse Pick event not picking up any game objects
« Reply #1 on: May 07, 2012, 02:00:53 AM »
I'll take a look at the project, but I deleted the link from your post. Can you also remove the file on your end please! Thanks!

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • Disastercake
Re: Mouse Pick event not picking up any game objects
« Reply #2 on: May 07, 2012, 10:51:49 AM »
I've deleted it.  =D

Is there a better way to get files to you?

Thanks for the quick response.
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Mouse Pick event not picking up any game objects
« Reply #3 on: May 07, 2012, 01:22:55 PM »
You can email me directly using the email in my forum profile.

Or if you want to post on the forums, so others can help you too, make sure the playmaker dlls are not in the zip/unitypackage.

I checked your scene and the problem is you have 2 cameras marked as the MainCamera. Unity returns the first camera marked as the MainCamera, which in this case is not the one attached to the player! So the Mouse Pick was being performed from the wrong camera, giving strange results...

If you delete the MainCamera at the scene root everything should work as expected.

This seems like an easy mistake to make in Unity... maybe I'll add a check to Playmaker to catch this...
« Last Edit: May 07, 2012, 01:24:27 PM by Alex Chouls »

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • Disastercake
Re: Mouse Pick event not picking up any game objects
« Reply #4 on: May 08, 2012, 12:33:40 AM »
Works perfectly.  Thank you VERY much for your awesome support and this amazing tool!

I agree it might be a good idea to add that extra warning in there for the multiple cameras.  I will make sure I don't do that again, but it's almost impossible to troubleshoot unless you know Unity or have someone like yourself saying what's wrong.
« Last Edit: May 08, 2012, 12:35:14 AM by Disastercake »
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com