playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Download the
Ecosystem Browser
to find new actions, samples. etc.
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
iOS Help
»
2D movement
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: 2D movement (Read 4751 times)
NAME
Playmaker Newbie
Posts: 4
2D movement
«
on:
December 11, 2013, 02:01:37 PM »
Hello
What is the best way to do a 2D XY character movement on a iOS device? I am a bit confused. I want the 2D character to move to where I touch the screen. What actions should I use? I am able only to set a WASD/arrow key movement.
Thanks
Logged
jeanfabre
Administrator
Hero Member
Posts: 15500
Official Playmaker Support
Re: 2D movement
«
Reply #1 on:
December 11, 2013, 02:22:02 PM »
Hi,
quite involving despite what seems to be an easy thing.
you'll need a special custom action to transform a screen point into a point in space on a defined plane ( the ground).
http://hutonggames.com/playmakerforum/index.php?topic=272.0
then once you have that world position, you use the "move towards" action to move the character, but that's not just it, you will need to animate it likely, so your character behavior has to be designed so that it doesn't responds to input to rely on its animation, but on its own movement.
bye,
Jean
Logged
NAME
Playmaker Newbie
Posts: 4
Re: 2D movement
«
Reply #2 on:
December 13, 2013, 12:21:40 PM »
Hello
I would also like to know how to set a collision between a 2D character and 2D object? I do not want the 2D character to go through the 2D object.
Thanks
Logged
jeanfabre
Administrator
Hero Member
Posts: 15500
Official Playmaker Support
Re: 2D movement
«
Reply #3 on:
December 14, 2013, 01:16:15 PM »
Hi,
Both objects have to have a physics 2d and collider 2d not set to "is trigger" and they won't overlap each other.
bye,
Jean
Logged
NAME
Playmaker Newbie
Posts: 4
Re: 2D movement
«
Reply #4 on:
December 14, 2013, 03:38:32 PM »
Hello
Yes but this is working only when for example I set a 2D character in the air over a 2D object and when I play the scene the 2D character falls on the 2D object and does not go through. But when I am moving the 2D character with touch on a iOS device it always goes through the 2D object like it is not an obstacle.
Thanks
Logged
jeanfabre
Administrator
Hero Member
Posts: 15500
Official Playmaker Support
Re: 2D movement
«
Reply #5 on:
December 15, 2013, 05:30:19 AM »
Hi,
how do you actually move that object with the touch?
You should try using a spring and move the spring and have your 2d object attached to that spring, then all collision should work better.
bye,
Jean
Logged
NAME
Playmaker Newbie
Posts: 4
Re: 2D movement
«
Reply #6 on:
December 15, 2013, 10:04:11 AM »
Hello
The way it moves is a 2D version of this:
Tutorials/iOS Fundamentals/09 - Touch Info (starts at 26:40)
Thanks
Logged
jeanfabre
Administrator
Hero Member
Posts: 15500
Official Playmaker Support
Re: 2D movement
«
Reply #7 on:
December 16, 2013, 06:55:05 AM »
Hi,
ok, yes, prefer using springs then,
bye,
Jean
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
iOS Help
»
2D movement