playMaker

Author Topic: [SOLVED] Touch Action that does the same thing as Mouse Pick?  (Read 2480 times)

jasperPT

  • Full Member
  • ***
  • Posts: 109
  • I am a VFX Animator teaching myself to make games
    • View Profile
[SOLVED] Touch Action that does the same thing as Mouse Pick?
« on: October 13, 2013, 08:28:23 AM »
I need to figure out a way of using a touch input the same as a Mouse Pick so that I can store what Game Object has been touched.

Im sure this is quite simple, but I can not for the life of me get it to work.

"Touch Object Event" does not work because it requires you to know what object you want to be touching.

Any help would be much apreciated.

Cheers,
Jasper

EDIT:

On another similar note, what I am trying to do is as follows:

Finger down.
 - Check to see if the correct object was selected
 - Get position of the object
 - Compare my current finger position to the position of the object (every frame)
 - I need this to be every frame so that I can change the graphic depending on where the finger is relative to the object selected (like a mouse down menu)

Finger up
 - If my finger was released while the finger was over the object then shoot a bullet.

- If my finger was 1 unit above (screenspace Y) to my selected object then create a wall.

Note that this will be happening in multiple locations at once, so it needs to know independently what finger is touching in what location.
« Last Edit: October 13, 2013, 02:48:39 PM by jasperPT »

jgalvezpa

  • Junior Playmaker
  • **
  • Posts: 58
    • View Profile
Re: Touch Action that does the same thing as Mouse Pick?
« Reply #1 on: October 13, 2013, 10:55:37 AM »
Mouse Pick works for touch and mouse

jasperPT

  • Full Member
  • ***
  • Posts: 109
  • I am a VFX Animator teaching myself to make games
    • View Profile
Re: Touch Action that does the same thing as Mouse Pick?
« Reply #2 on: October 13, 2013, 10:56:49 AM »
yes but I need to use touch. As I am having two players input on the same screen at the same time in different locations. And you can not do this with mouse actions.


jgalvezpa

  • Junior Playmaker
  • **
  • Posts: 58
    • View Profile
Re: Touch Action that does the same thing as Mouse Pick?
« Reply #3 on: October 13, 2013, 11:15:19 AM »

like  i said use Mouse Pick and then Touch event action.
the mouse pick will store the object that you are touching

jasperPT

  • Full Member
  • ***
  • Posts: 109
  • I am a VFX Animator teaching myself to make games
    • View Profile
Re: Touch Action that does the same thing as Mouse Pick?
« Reply #4 on: October 13, 2013, 02:13:46 PM »
yes this works fine, but as soon as somone clicks somewhere else on the screen my selection will change. This is due to me needing to use it on every frame to figure out what I have selected or what position I am currently clicking on. (there will be multiple clicks and holds going on screen at the same time to do different things)

Sorry I should have been a little more clear, I have updated the original post to show what I need.

jasperPT

  • Full Member
  • ***
  • Posts: 109
  • I am a VFX Animator teaching myself to make games
    • View Profile
Re: Touch Action that does the same thing as Mouse Pick?
« Reply #5 on: October 13, 2013, 02:48:20 PM »
Never Mind I solved it using get touch info and screen pick after a rather long brain bashing against the computer.

Cheers for the help though!