playMaker

Author Topic: Problem with "touch Object Event" and multiple cameras  (Read 2689 times)

bluequoll

  • Playmaker Newbie
  • *
  • Posts: 3
Problem with "touch Object Event" and multiple cameras
« on: May 27, 2012, 11:11:16 PM »
Hello there,

I am setting up a simple game for kids that is supposed to work like this. There is a drawing in the background where kids need to find objects hidden. I have set up the mainCamera to render this.

Obviously on the background there are objects that can be touched (ios) and interacted with. I have managed this easily with Object Touch Event. So all the hidden object when touched, disappear from the scene.

I also have a simple UI layered on top of this background consisting of few buttons to go back to home page, and zoom in to increase the size of the drawing to look for smaller details. These buttons are created using 2Dtoolkit plugin.

 I have set up a second camera (UICamera) for the buttons for the simple reason that I do not want the buttons to scale up when the zoom button is pressed and to remain of the same size and position as pre-zoom. Unfortunately it seems that if I set object touch event on these buttons, because they are rendered by a secondary camera (tag: untagged) the event would just not fire. I have tried setting both cameras as main but what happens is that the Action Object Touch Event works only with the camera that has the lower layer value.

Is there something I could do to solve this issue?

Thank you very much for your time, enjoying PLaymaker very much here ;)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problem with "touch Object Event" and multiple cameras
« Reply #1 on: May 30, 2012, 02:31:44 AM »
hi,

 I think you should contact 2d toolkit and ask about this. Haven't gone that far with 2d toolkit yet myself so can't really help you. I know that with EZGUI this kind of things are sorted with a manager, where you dfeine which camera should check for touch etc etc, so I assume 2d toolkit might have something.

 the other thing tho, could be that if your camera are not in the same place, then the mouse pick position is of course wrong.

 you could get away with one camera by attaching the ui to the camera, could that not be an easier way to manage your scene? I do use multiple camera set up, so not saying its wrong, it just might not be necessary here.

Bye,

 Jean