When collides-center actor 1 on actor 2

iTouchGameriTouchGamer Member Posts: 681
edited November -1 in Working with GS (Mac)
Ok, so I have random objects falling from the sky(actor 1), and something moving at the bottom (actor 2). When actor 1 collides with actor 2, actor one goes on top of actor 2(like stacking), but how can I make it so actor 1 centers on actor 2?

I have searched but nothing has worked so far.

Comments

  • jobonoobdudejobonoobdude Member Posts: 152
    Make two real game attributes, name then playerX, and playerY(or whateverX and Y)
    then in actor two have two constrain attributes, one saying playerX to self.Position.X, and the other saying playerY to self.Position.Y
    then in actor one make a rule that says
    actor receives event, overlaps or collides with, actor 2
    constrain attribute self.positon.X to playerX
    constrain attribute self.Position.Y to playerY

    that should do it.
  • iTouchGameriTouchGamer Member Posts: 681
    Tried it, doesn't work. Makes everything start to shake. It might have to do with other rules I have, I'll make a new project and test it.
  • MotherHooseMotherHoose Member Posts: 2,456
    On scene screen

    click on actor1

    Rule when
    collides with actor2
    --Change (or Constrain) Attribute [exp] self.Position.X To:
    [exp] >Current Scene>layers>layerActor2on>actor2>Position>X

    I don't know if you have coded things like Linear Velocity... Accelerate... but other things may have to be changed ... prevent conflicts.

    MH
  • iTouchGameriTouchGamer Member Posts: 681
    I'll try that, thanks!!

    Edit-how do I do the second part, the one where I go to scene, etc...?
Sign In or Register to comment.