Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Caden676 |
I am making a topdown game similar to stardew valley in the perspective, I have a tilemap which contains all the trees on the test level. I want to use a area2D with a circular collision shape to use the .overlaps_area function to see if any trees are nearby and if so I am going to turn the opacity down. Currently it wont detect any trees. I am pretty new and this is one of my first projects. Here is the current code I am trying to use…
var Trees = get_node(“/root/World/Tiles/Trees”)
if $Area2D.overlaps_area(Trees):
print("Tree")
//I am using a variable to find the node since I could not plugin the node path directly
//into the if statement.