Question about moving character based on touch action
madmassey
Member Posts: 55
Hey guys. I'm just learning the toolset so bear with me if the answer is obvious, heh.
I'm trying to make a player actor move based on a screen touch action. I have an attribute boolean named Player Movement. Whenever the background detects a touch press, I set the boolean to true. Otherwise, false.
Then on the player actor, when the boolean true is detected, I set a Move To behavior with coordinates game.Touches.Touch 1.X and game.Touches.Touch 1.Y. I added some numbers to the ends of those values to make the touch action signify where the characters feet go. Run to completion is also selected.
This seems to work just fine, though the player does sometimes run off in a different direction if I click one of my collision actors instead of the floor. The main problem is that I have the screen scrolling to the side based on a Control Camera on the player actor. Whenever the camera is on something besides 0, 0 coordinates, my touch movement becomes wildly inaccurate. If my background is scrolled to the left, the player runs to the right as if he's running away from me.
Any ideas? Help would be greatly appreciated.
I'm trying to make a player actor move based on a screen touch action. I have an attribute boolean named Player Movement. Whenever the background detects a touch press, I set the boolean to true. Otherwise, false.
Then on the player actor, when the boolean true is detected, I set a Move To behavior with coordinates game.Touches.Touch 1.X and game.Touches.Touch 1.Y. I added some numbers to the ends of those values to make the touch action signify where the characters feet go. Run to completion is also selected.
This seems to work just fine, though the player does sometimes run off in a different direction if I click one of my collision actors instead of the floor. The main problem is that I have the screen scrolling to the side based on a Control Camera on the player actor. Whenever the camera is on something besides 0, 0 coordinates, my touch movement becomes wildly inaccurate. If my background is scrolled to the left, the player runs to the right as if he's running away from me.
Any ideas? Help would be greatly appreciated.
Comments
here you go...follow firemaples answer...
http://gamesalad.com/forums/topic.php?id=5897