Make actor follow touch/mouse-click
mikkelnymand@gmail.com
Member Posts: 7
Hello everyone
I'm making a game were stuff drops, and you catch it with something - Being a basket in my case.
So, how do i move the basket following the touch or mouse and constraint it to the x-asis only and not dragging it off screen?
I've tried with the move Behavior in a rule. Hope someone cna help
I'm making a game were stuff drops, and you catch it with something - Being a basket in my case.
So, how do i move the basket following the touch or mouse and constraint it to the x-asis only and not dragging it off screen?
I've tried with the move Behavior in a rule. Hope someone cna help
Comments
I have an actor filling the area where i want the basket to move and gave it:
If actor.receives.event.touch.pressed > Change attribute: game.move to 1
Else
Change attribute: game.move to 0
For the basket i gave:
If attribute game.move = 1 > Move to game.Mouse.Position.X and for y.
The basket just kinda jumps around randomly when i press the screen
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS