• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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