Is there way we can make the Alpha a part of the condition of contact?

Dell7730Dell7730 Member, PRO Posts: 388

Just wondering if this can be incorporated to a condition, say for example between two actors that collide, if Actor 1 collides with Actor 2, they bounce from each other..... now say same condition but actor 2's Alpha is 0 as in invisible, can I make that a part of the rule that if it's invisible, there's no collision to happen regardless what the collision shape is, circle or rectangle.

Best Answer

  • SocksSocks London, UK.Posts: 12,822
    edited April 2015 Accepted Answer

    @Dell Agarpo said:
    How bout this question? A PNG image, there are parts of it that isn't visible, say a square PNG, half is visible, half is not, will that empty part be still considered Alpha = 1?

    There is no considering at all in GameSalad ! :smile: If you set the alpha of the actor to 1 then the actor will have an alpha value of 1, if you set the alpha of the actor to 0 then the actor will have an alpha value of 0 - regardless of what is in the picture.

    Collisions in GameSalad are with the actor and not with the image, hope that makes sense.

Answers

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited April 2015

    Yes. Just make a rule on Actor 2 that says:

    -If self.alpha = 1

    do

    -Collide behavior.

    That way the collision will happen only when actor 2's alpha is 1.
    Just make sure you don´t have a separate collide behavior in Actor 1 or Actor 2.

    Mental Donkey Games
    Website - Facebook - Twitter

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2015

    Rule for Actor 2.

    When (All) conditions are valid:

    Actor overlaps or collides with Actor 1
    Attribute: Actor 1's alpha = 1

    Do action.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @NipaDidIt said:
    @Socks said:

    How bout this question? A PNG image, there are parts of it that isn't visible, say a square PNG, half is visible, half is not, will that empty part be still considered Alpha = 1?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Collisions in GameSalad are with the actor and not with the image, hope that makes sense.

    It does make sense, I just simply wanted to ask, lol

Sign In or Register to comment.