GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

catching dropping objects

AKBAKB Posts: 7Member
edited November -1 in Tech Support
Hello,

I have a plate that's movable my touch. The user, through moving the plate, tries
to catch items dropping. How can I have items that are caught or touch the plate
stick to the intial position they touched the plate at. Details would be very helpful,
as I am relatively new to GameSalad.
Thanks!

Comments

  • dmilinovichiiidmilinovichiii Posts: 620Member
    Create a rule so that it says if the plate touches or overlaps with the dropping item. Then put a constrain attribute behavior in the rule that constrains the plate's X and Y motion to 0.
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    Mr.Rinoy said:
    Create a rule so that it says if the plate touches or overlaps with the dropping item. Then put a constrain attribute behavior in the rule that constrains the plate's X and Y motion to 0.

    That wont work. The items will stop moving. You want them to move with the plate.

    You need to constrain the plate's x position to a global integer attribute (call it game.plateX or something).

    Then in the falling item:

    Rule - when actor collides/overlaps with plate
    constrain self.position.X to game.plateX
    constrain self.position.Y to (whatever the Y value is for the plate as I am assuming you are only moving it back and forth.)
This discussion has been closed.