Drag Objects

creativeappscreativeapps Member Posts: 1,770
edited November -1 in Working with GS (Mac)
I have 2 objects one is graphics and one is working as collide. graphic object is on collide object. And same time when I drag graphics object I also want to drag collide object with that. How to do this? Please help me out.

Comments

  • creativeappscreativeapps Member Posts: 1,770
    anyone here please help me out
  • creativeappscreativeapps Member Posts: 1,770
    anyone please?
  • StormtrixStormtrix Member Posts: 256
    I'd say --
    goto into the graphics actor and do this for just the touch/move part

    To drag an actor it's just
    Rule - Actor receives touch - pressed
    Constrain Attribute: self.position.X To: game.Touches.Touch 1.X
    Constrain Attribute: self.poisition.Y To: game.Touches.Touch 1.Y

    Then go into the Collide Object Actor's Instance within the scene and unlock it.
    Then put -
    Constrain Atrribute: self.position.X To: Current Scene.Layers.Background.GraphicsActor.Position.X
    Constrain Atrribute: self.position.Y To: Current Scene.Layers.Background.GraphicsActor.Position.Y

    this will have the collide actor move on top of and with the graphics actor.
    if you want the collide actor to not be on top of the graphics actor then at distance like
    Current Scene.Layers.Background.GraphicsActor.Position.X+50
    Current Scene.Layers.Background.GraphicsActor.Position.Y+50

    etc...
    Tshirtbooth has a video tutorial on this somewhere, searched his youtube page and couldn't find it.

    hope that helps.
    Storm
  • creativeappscreativeapps Member Posts: 1,770
    thanks great its really works. Thanks a lot
Sign In or Register to comment.