Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | szccornish |
func _process(delta):
— var bodies = get_overlapping_bodies()
----for body in bodies:
-------if (body.get_name() == PLAYERNAME):
----------stairs.material.set(“shader_param/width”, 0.5)
------else:
--------if (body.get_name() != PLAYERNAME):
-------------stairs.material.set(“shader_param/width”, 0.0)
hello can somebody help me? im trying to make the shader go “on” and “off” if the player get in the area2D.
until the statment “if” is work fine. but when i but the “else” statement. it doesn’t work at all for both.
i wonder if someone have an insight?
nvm i find a way… i use body_exited instade of :
--------if (body.getname() != PLAYERNAME):
-------------stairs.material.set(“shader_param/width”, 0.0)
szccornish | 2021-06-02 15:02