Playmaker Forum

Playmaker Help & Tips => Playmaker Help => Topic started by: dbsrb43 on February 12, 2013, 11:25:59 PM

Title: half side touch to control character invisible gui?
Post by: dbsrb43 on February 12, 2013, 11:25:59 PM
Like the famous game line runner, I want to make my character jump when I touch the right half of the screen. And slide on the left side.... How do i do this? invisible gui??
How can I make invisible gui?? New to these stuff
Alternatives would be great.
Thanks
Title: Re: half side touch to control character invisible gui?
Post by: escpodgames on February 13, 2013, 12:55:43 AM
Easy - Use touch position

Get touch info Action will give you the X and Y position of the touch (normalized)
(the bottom left is 0,0 and top right 1,1)

Float compare - if touch x is greater than 0.5 its a right hand side touch if its less its a left hand side touch.

Hope that makes sence, I can show an example if that helps.
Title: Re: half side touch to control character invisible gui?
Post by: dbsrb43 on February 13, 2013, 06:31:42 AM
I'm having a hard time using floats....
maybe, can u make a really simple scene with this??
action could be really basic. For example Umm.. if left side is touched the cube deletes...
I would be able to do it myself from there on..
my email is dbsrb43@gmail.com
If u can screen capture some steps and send it to me, that would be awesome
Thanks in advance
Title: Re: half side touch to control character invisible gui?
Post by: escpodgames on February 13, 2013, 05:13:56 PM
Here ya go -

(http://img405.imageshack.us/img405/9940/touchu.jpg) (http://imageshack.us/photo/my-images/405/touchu.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)
Title: Re: half side touch to control character invisible gui?
Post by: dbsrb43 on February 17, 2013, 06:23:25 AM
Thanks, get the idea.. but i've made the variable called Touch_x and did what the screencap told me to do....
But nothing happens in mobile.. not getting deleted??
What type of Touch_x has to be?? (in the variable drop down thingy, when created a variable, the drop down to change the type.??
thanks
Title: Re: half side touch to control character invisible gui?
Post by: escpodgames on February 17, 2013, 07:21:13 PM
touch_x should be a float ... also just noticed I didn't make the get touch info Every Frame (the tick box at the bottom)
Title: Re: half side touch to control character invisible gui?
Post by: dbsrb43 on February 18, 2013, 01:44:44 AM
Hmmm but what is this??/
I've uploaded a video for my problem..
What's wrong??/
Title: Re: half side touch to control character invisible gui?
Post by: escpodgames on February 18, 2013, 02:03:15 AM
The only thing i can see is the compare float is above the touch info action ... but that should still work :S

Are you actually trying this on a mobile device? when you said "touch" did you actually mean on an iPhone/ipod/ipad/ android?
Title: Re: half side touch to control character invisible gui?
Post by: gamedivision on February 18, 2013, 02:34:39 AM
Guessing without actually testing,I would have an ngui button delete the image and font,using only the collider make it half the size of the screen,then use on OnClick event
Title: Re: half side touch to control character invisible gui?
Post by: dbsrb43 on February 18, 2013, 05:23:15 AM
Yes I've tested on my droid and still has a same effect...,
Title: Re: half side touch to control character invisible gui?
Post by: dbsrb43 on February 18, 2013, 05:31:51 AM
Can u create a simple scene for me?? I can test it on my device.
That would be nice^^
Title: Re: half side touch to control character invisible gui?
Post by: escpodgames on February 19, 2013, 03:50:52 PM
I think the best thing you could do is go through the Playmaker iOS tutorials, thats where I first started.

http://www.youtube.com/playlist?list=PLD8AAC983AAD87D01

Setting up onscreen debug GUI text is always a good way to test on mobile platforms - touch positions, touch count, playmaker states etc

Take a look and if you still cant get it to work, ill make you a scene (and test it)