npc.tscn 872 B

12345678910111213141516171819202122232425262728293031
  1. [gd_scene load_steps=4 format=2]
  2. [ext_resource path="res://placeholder.gd" type="Script" id=1]
  3. [sub_resource type="RectangleShape2D" id=23]
  4. [sub_resource type="RectangleShape2D" id=24]
  5. extents = Vector2( 300, 64 )
  6. [node name="npc" type="KinematicBody2D" groups=["enemy"]]
  7. collision_layer = 12
  8. collision_mask = 0
  9. script = ExtResource( 1 )
  10. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  11. shape = SubResource( 23 )
  12. [node name="RayCast2D" type="RayCast2D" parent="."]
  13. enabled = true
  14. cast_to = Vector2( -300, 0 )
  15. collision_mask = 2147483650
  16. [node name="Area2D" type="Area2D" parent="."]
  17. collision_layer = 0
  18. collision_mask = 2147483650
  19. [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
  20. position = Vector2( 0, -54 )
  21. shape = SubResource( 24 )
  22. [connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]