Dragging an actor

Hi, I'm making a sniper app and I want to make it so you can drag the scope and move it around when you drag it on the screen, what behaviours would I need for that, also I'm using GameSalad on WIndows.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    You mean like this?



    http://www.deepblueapps.com/doodle-sniper/

    Darren.
  • jack.zainudin@live.comjack.zainudin@live.com Member Posts: 25
    edited July 2013
    No, I want it so you drag your thumb over the scope and it moves with your thumb
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Constrain the actors x and y location to your touch location.
  • How do you Constrain the actors x and y location to your touch location.
  • zoopezoope Member Posts: 210
  • jack.zainudin@live.comjack.zainudin@live.com Member Posts: 25
    edited July 2013
    How do I make it so an actor will follow my finger, as I drag my finger across the screen?
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    rule:

    if pressed

    behavior : constrain
    self position x to 'device, touch pos X'
    self position y to 'device, touch pos Y'.

    if you've got a camera you need to add an offset..

    Search the forum for a more detailed reply, or GS helper / YouTube for a tutorial.

  • guillefaceguilleface Member, BASIC Posts: 1,039
    constrain self.position-x to device.mouse.position.x
    constrain self.position-y to device.mouse.position.y
    i hope thats what you trying to do.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Three discussions on the same topic merged.

    Please don't make multiple discussions for the same thing.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    How do you Constrain the actors x and y location to your touch location.
    I think you are getting ahead of yourself, this is a pretty basic concept, and if you don't build a solid foundation you are going to find yourself in deep water. Please take some time and go through the entire cookbook and watch every youtube video you can find. You will be so much better prepared for what you want to do.
Sign In or Register to comment.