Is there way we can make the Alpha a part of the condition of contact?
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
-
Socks London, UK.Posts: 12,822
@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 ! 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
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
Rule for Actor 2.
When (All) conditions are valid:
Actor overlaps or collides with Actor 1
Attribute: Actor 1's alpha = 1
Do action.
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?
It does make sense, I just simply wanted to ask, lol