I'm able to use my code to push blocks, and it was working fine, but I wanted to make sure I couldn't push a block into a wall, or another block. to do that, I added some code...
`func _process(delta):
for body in area_right.get_overlapping_bodies():
if body.is_in_group("Player"):
if(hero.get_collision_layer() == 1):
arrow_left.show()
if Input.is_action_just_pressed("Push"):
move_left()
func move_left() -> void:
for body in area_left.get_overlapping_bodies():
if(body.get_collision_layer() == 1):
print("Nope")
else:
print("works")
block.position.x -= 1 * 128`
everything from "for body in area_left" to "print("works")" is what I added. everything works, up to printing "Nope". but now, a block in front of me or not, I can't push to the left, or even print the word "works". I'm still pretty new to Godot, and coding, so I'm sure I'm missing something obvious here.