playMaker

Author Topic: Object specific action is activated even if i click somewhere not on the object  (Read 1522 times)

nrefzen

  • Playmaker Newbie
  • *
  • Posts: 1
I'm new to Unity and Playmaker. I was working on a project, the idea is to have a room where if you click on an object (see image attached) the result will be a switch to a different camera, a second click on the object will result in a simple action for the object, for example, the laptop rotates. A third click would return to the main camera.

I have added a FSM to a specific object, using GET MOUSE BUTTON DOWN, to facilitate this. I'm able to get the camera change, action and return to original state working. However I want this to only happen when I click on the object. Instead if I click anywhere on the scene the action still happens. If i Add FSM to another object, it overrides the previous action and only the new FSM works.

Where am I going wrong, how can i make sure the action only takes place when i click on the object only.

Any help would be gratefully appreciated. Please let me know if any more data will be useful.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
You can use Mouse Pick for this, store the object, do a compare and send the event you want.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

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

 also, are you sure you are only receiving mouse events on the object you clicked, and not a general mouse click, unrelated to what's beneath it?

bye,

 Jean