First Actor to collide Question...

DimensionGamesDimensionGames PRO Posts: 993
edited November -1 in Working with GS (Mac)
Hey all,

I know the title isn't exactly descriptive but I had no clue how to sum it up! Basically I have an actor and I want to determine which of two actors collide with it first any suggestions?

Cheers.

Comments

  • RodrigoPerezRodrigoPerez Member Posts: 212
    A good title might be "Actor Collision Detection" anyways you could have

    if movingactor1 collides with actor change color to red
    if movingactor2 collides with actor change color to blue

    So then you know which one hit your actor first by which color it flashes.
  • gamedivisiongamedivision Member Posts: 807
    maybe when actor collides with display text put 1 in each and the one that shows first is the first

    or the better one above my post ha ha
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I think its really based on where in the layers the actors are as to which on registers first. GameSalad reads the actors from the bottom to the top in the layers list and then the rules from the top down in each actor. So the lower actor is the one that will likely register first everytime.

    Granted were talking Fractions of a second here.
  • DimensionGamesDimensionGames PRO Posts: 993
    Thanks for the replies guys but It was more for using for attributes. I understand the methods you have suggested and use them all the time :D The problem I faced was that if I had a simple rule such as change attribute to 1 then when the second collided it would change it :(

    Cheers.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Im pretty sure you are not going to be able to make a detection like you are wanting with GameSalad
  • DimensionGamesDimensionGames PRO Posts: 993
    Does that mean you cannot create games such as pool? As that relies on this system.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Why would pool Rely on knowing if actor 1 hit actor 2 or if actor 2 hit actor 1?

    Maybe i'm not understanding what you are wanting

    Do you mean you have 3 actors. actor1 is getting hit by actor 2 or actor3? and you want to know if actor 2 or 3 hit actor 1 first?

    For that I would do an integer attribute and set it to 0

    Then I would have in actor 1

    If overlap/collide with actor2
    and game.Collidenumber = 0
    --Change game.collidenumber to 2
    Otherwise
    --If overlap/collide with actor3
    and game.Collidenumber = 0
    ----Change game.collidenumber to 3
  • DimensionGamesDimensionGames PRO Posts: 993
    Thats the ticket! Sorry I was struggling to write anything after a long day :L Thanks again, love this community learning so much! :)

    Cheers.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
Sign In or Register to comment.