playMaker

Author Topic: custom action to "touch object event" with multiple cameras?  (Read 1286 times)

Orjax

  • Playmaker Newbie
  • *
  • Posts: 21
  • Father/son team, self taught, love learning
custom action to "touch object event" with multiple cameras?
« on: April 19, 2017, 06:08:17 PM »
Can someone make a custom action that will allow me to "touch object event" from multiple cameras?

I have a game with a second camera as a sort of inventory/toolbar at the bottom.
Problem is i have to keep switching "main camera" with another button to enable touch event in second camera.  then switch back.  Is there a way to make a custom action that will allow touch event in whichever camera bounds is touched.
My main camera (1st person, is the whole screen,  second camera is at bottom center (top .8, left .2,  width .6, height .2)
(i tried using a grid autolayout with buttons, playmaker gui Prefab, and proxy component, but could not get "send event" to work, after days of research,(doing exactly like tutorial, i decided to do it this way).  but worked perfectly with sprite(or 3d) touch obj, then FSM with touch object event to a "send event" state action to FSM i want.)

I can make it work, but just thought I'd post to ask if a custom action could pick whichever obj from whichever camera.  Obviously depth is set diff on each camera so they overlap, and can both be seen.  If the action could check for obj in top camera first, and if no obj, then check if raycast hit second camera obj,  or something like that.

Sorry for the long explanation and request,  not good at coding, but trying, and loving anything game making.  Thanks in advance.

seen several people with same prob of multiple cameras and "mouse pick" and "touch object event"  this solution could help.  (if in my hours of research, i missed a similar solution, please forgive me, but i looked everywhere)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: custom action to "touch object event" with multiple cameras?
« Reply #1 on: April 20, 2017, 03:18:14 AM »
Hi.
I think you should consider using Unity UI.
You can get the actions on the Ecosystem.
Search for 'Ugui proxy full'

You can find some tutorials on the User tutorial wiki page


Orjax

  • Playmaker Newbie
  • *
  • Posts: 21
  • Father/son team, self taught, love learning
Re: custom action to "touch object event" with multiple cameras?
« Reply #2 on: April 21, 2017, 04:31:10 PM »

I found the problem with uGUI,  Now it works.
I just want to post this in case someone else struggles.  I used the prefab first person, and the setting on the controller "lock cursor" was checked.  No gui buttons worked, after messing around with second camera and other options(hence my request for custom action), I went back to gui and finally messed with the right thing.  Now i can use gui buttons and proxy component like I wanted to in the beginning.

So, if "lock cursor" is checked, gui will not work.  Hope this helps someone else.