Downloads · 30 days
0
Nawafbdyd/Ggo
Ggo is a machine learning model from Nawafbdyd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Jul 27, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md2.7 KB · 64%
From the Hugging Face model README
extends CharacterBody3D
enum State { PETRIFIED, TRANSFORMING, CHASING } var current_state = State.PETRIFIED
@export var player_path: NodePath @export var wake_up_distance: float = 5.0 @export var chase_speed: float = 6.0
@onready var player: Node3D = get_node_or_null(player_path) @onready var anim_player: AnimationPlayer = $AnimationPlayer @onready var nav_agent: NavigationAgent3D = $NavigationAgent3D
func _physics_process(delta: float) -> void: if not player: return
# حساب المسافة الحالية بين الوحش واللاعب
var distance_to_player = global_position.distance_to(player.global_position)
match current_state:
State.PETRIFIED:
# إذا اقترب اللاعب من التمثال يبدأ بالتحول فجأة
if distance_to_player <= wake_up_distance:
trigger_transformation()
State.TRANSFORMING:
# حالة الانتظار أثناء التحلل وقلب الرأس
pass
State.CHASING:
chase_player(delta)
func trigger_transformation() -> void: current_state = State.TRANSFORMING
# تشغيل أنيمايشن قلب الرأس وتكسر الحجر والنزول بظهر مستقيم
if anim_player and anim_player.has_animation("FlipHeadAndAwake"):
anim_player.play("FlipHeadAndAwake")
# مؤقت لمدة 3 ثوانٍ حتى ينتهي التحول ثم يبدأ بالركض بـ 6 أطراف
await get_tree().create_timer(3.0).timeout
start_chasing()
func start_chasing() -> void: current_state = State.CHASING
# تشغيل أنيمايشن الزحف السريع المستقيم بالـ 6 أيادي
if anim_player and anim_player.has_animation("IsCrawling"):
anim_player.play("IsCrawling")
func chase_player(_delta: float) -> void: if not nav_agent: return
# توجيه نظام الملاحة التلقائي نحو موقع اللاعب الحالي
nav_agent.target_position = player.global_position
if not nav_agent.is_target_reached():
var next_path_position = nav_agent.get_next_path_position()
var current_position = global_position
# حساب اتجاه وسرعة المطاردة
var new_velocity = (next_path_position - current_position).normalized() * chase_speed
# جعل الوحش يلتفت بوجهه المقلوب نحو اللاعب مباشرة أثناء الزحف
var look_target = Vector3(player.global_position.X, global_position.Y, player.global_position.Z)
look_at(look_target, Vector3.UP)
rotate_y(PI) # تعديل زاوية الالتفات ليواجه اللاعب بشكل مقلوب ومخيف
velocity = new_velocity
move_and_slide()