Windows when the player gets close, the objects fade out but...How can i do it???

ShadowLenz

Member
there is a way for an object to disappear when the character gets close to him?, like...the opacity goes off when its close and appears again when its far away???

like:

if (distance to object (object_that needs_to_fade_out)<32) {

*some code to make disappear*
}

first i thought using "object_set_visible" but i got my doubts
 

Reed

Member
You're looking for image_alpha.

If you want a smooth fade you can do something like

image_alpha=min(1,point_distance(x,y,obj_player.x,obj_player.y)/range)

Where range is the closest distance at which the image is fully visible.
 

ShadowLenz

Member
You're looking for image_alpha.

If you want a smooth fade you can do something like

image_alpha=min(1,point_distance(x,y,obj_player.x,obj_player.y)/range)

Where range is the closest distance at which the image is fully visible.
thank you so MUCH!
 
Top