Make actor follow touch/mouse-click

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 :)

Comments

  • Ok so i currently have the following which kinda works..

    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
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    There is a video on drag and drop at GShelper.
Sign In or Register to comment.