Topic was automatically imported from the old Question2Answer platform.
Asked By
dragon
For example in a 2D game if my character walks behind a tree, I want that tree to become translucent. Prior to Godot 3.0, I believe you could set a CollisionShape2D and then click the trigger option, to see if an object entered a certain area, I don’t know how to do this now.
I found out the answer is to attach an AreaDetector2D to the object you want to react to the trigger object which enters the trigger area. You then attach a CollisionShapePolygon2D or a CollisionShape2D to the AreaDetector2D, and then click on the Node tab for the AreaDetector2D, click on body_entered and then click on connect a popup dialog will appear and then click on the original object for example if you named that object a “wall”, then click connect. Godot will then create a listener function for you to write your code into for example you want to make the wall transparent or translucent or whatever you can do it here.