diff --git a/Game/objects/goal.tscn b/Game/objects/goal.tscn new file mode 100644 index 0000000..1025014 --- /dev/null +++ b/Game/objects/goal.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=3 uid="uid://cofdcxo5170rs"] + +[sub_resource type="BoxMesh" id="BoxMesh_4ngif"] +size = Vector3(3.5, 1.5, 0.1) + +[sub_resource type="BoxShape3D" id="BoxShape3D_nmd5r"] +size = Vector3(3.5, 1.5, 0.1) + +[node name="Goal" type="Area3D"] + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +mesh = SubResource("BoxMesh_4ngif") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("BoxShape3D_nmd5r") diff --git a/Game/scripts/goal2.gd b/Game/scripts/goal2.gd new file mode 100644 index 0000000..1cf59fc --- /dev/null +++ b/Game/scripts/goal2.gd @@ -0,0 +1,14 @@ +extends Area3D + +@export var ball: RigidBody3D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if (overlaps_body(ball)): + print("Goal scored in goal 2")