func change_color():
if is_colliding:
color_rect.color = Color(1, 0, 0)
Question
Hello good people of the forum! im a beginner in coding and Im trying to escape tutorial hell and make some simple games on my own. Yet as you will see im struggling with pretty simple tasks such as writing correct syntax.
Here im trying to make the color.rect change color when the player collides with the Area2d node. I am using groups for my Area2d nodes and the _on_area_entered function works correctly as the debugger prints when the player collides with the platform, however I cant seem to figure out how to set up the color change correctly. Any help would be greatly appreciated!
Cheers
You need to call this function from somewhere. Maybe after the print("Colliding")
There is a toolbar on the window where you type your posts here. On that toolbar is an item that looks like this </>. That button encloses your posted code in such a way as to preserve tabs.
Code that is posted without that is all but unreadable as you can see in your post.
Hey, thanks for the reply I figured out the issue, i was using multiple colorRect inside a Node which apparently messes with their anchors being bundled at 0,0 and therefore my player was insta colliding with it. My bad, you live and you learn I guess