How do I change the opacity of objects that my character walks behind?

T

TheGreatZolaski

Guest
Hello,

I've finally got change of depth working for the different objects in my game. Now I want to be able to see through the objects that my character walks behind. I've looked online and couldn't find any tutorials. I am new to GMS2, but my game uses a combination of D&D and coding. If anyone can show me a tutorial or help out that would be awesome. Example of my character hidden behind a tree is attached. Thanks!
 

Attachments

2Dcube

Member
You can set an object's opacity with image_alpha in code.
If the code is executed inside the object:
Code:
image_alpha = 0.5;
There is also a "Color Sprite" drag and drop action I believe, which lets you set the alpha.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
There is also a "Color Sprite" drag and drop action I believe, which lets you set the alpha.
There is, and you can also use the Set Instance Variable action to set the "image_alpha" instance variable that way. :)
 
Top