How to make actor stack up?

AppsterAppster Member Posts: 112
edited November -1 in Working with GS (Mac)
Hi hi, I m new here and would like to check how to make actor stack up to each other? I have square actor and will drop vertically. i want to make it drop and stack in a container. I cant seems to be able to find it to stop at the right location. I have gravity set.

Comments

  • AppsterAppster Member Posts: 112
    Many thanks in advance to help a newbie like me.
  • outasiteoutasite Member Posts: 417
    Things to check

    -Stacking actors collide with one another
    -Collide behavior is at the top of code
    -Density is high

    Michael
  • AppsterAppster Member Posts: 112
    Thanks, Michael. I understand stacking actors has to set to collide but don't quite understand what you mean by collide behavior is at top of code. Would you be kind to elaborate a little more?
  • outasiteoutasite Member Posts: 417
    When you open the actor up to edit the code. Be sure that the behavior that tells yours actors to colide with one another is at the top of the screen.

    Example:

    ->Colide Behavior (At top)
    ->Change Attribute
    ->Rule
    --->Change Attribute
    --->Change Attribute

    GS runs the code like a que. The ones at the top of it, go first. We want the collide behavior to fire as soon as possible so that it doesn't "sink" into other actors.
  • AppsterAppster Member Posts: 112
    Thanks Michael. Got it, managed to get it stack. Just another question, if I have container which matches the same shape of the actor, how do I set it to accept the actor if it matches the shape of the actor and reject if it doesn't?
  • olster1olster1 Member Posts: 396
    outasite said:

    -Collide behavior is at the top of code

    Does the order of code make a difference? :O Learn something new everyday!
  • simo103simo103 Member, PRO Posts: 1,331
    appster said:
    how do I set it to accept the actor if it matches the shape of the actor and reject if it doesn't?

    You are going to have to create an attribute to label the actors and then compare that attribute with the 'correct' one when colliding with the container. I would use an integer and then you could have in rule if attribute =2 then correct, otherwise reject. Visually you would need to animate or bounce (reject) to make it look right.
  • AppsterAppster Member Posts: 112
    Thanx Simo, I shall give it a try.
  • outasiteoutasite Member Posts: 417
    olster1 said:
    Does the order of code make a difference? :O Learn something new everyday!

    Ya, be sure to order things most important in order of firing.
    simo103 said:
    You are going to have to create an attribute to label the actors and then compare that attribute with the 'correct' one when colliding with the container. I would use an integer and then you could have in rule if attribute =2 then correct, otherwise reject. Visually you would need to animate or bounce (reject) to make it look right.

    I was going to say the same thing. and then you could add sizes for added difficulty.
Sign In or Register to comment.