Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | furkan13246578 |
When you enter the character area in godot, the label should increase by +1, but when I use the code below, nothing happens.
extends Area2D
var label = 0
func _on_Area2D_body_entered(body):
if body.name == "Player":
label += 1
You’ve posted the same question twice.
SteveSmith | 2022-11-30 15:43
You have not provided much information about this, but off the top of my head, I would think that either one of two things are happening:
- Your Player Node is not a KinematicBody2D or a StaticBody2D, but is an Area2D
- Your Player’s name is not “Player”. It is better to use groups for this BTW.
- Have you enabled Monitoring on the Area2D node?
- Check your Collision Masks for both the Player Node and the Area2D node.
Juxxec | 2022-11-30 22:07