KyleRansford
Member
I'm wanting to create a transparency effect when the player walks under a tree, so that the alpha fades to 0, then after the player leaves, the alpha goes back to 1.
This is the code I've been trying out, but it only works without the else if statement.
What's a better way of doing this?
This is the code I've been trying out, but it only works without the else if statement.
GML:
if place_meeting(x, y, o_trigger) {
if instance_exists(tree_patch) {
o_tree_patch.image_alpha -= 0.05;
}
}
else if !place_meeting(x, y, o_trigger) {
if instance_exists(tree_patch) {
o_tree_patch.image_alpha += 0.1;
}
}
Last edited: