using Godot; public partial class Mouth : XRCamera3D { [Export] public float MaxEatWeight = 1.0f; [Export] public float EatGrowthFactor = 0.1f; [Export] public XRHand RightHand; [Export] public XRHand LeftHand; public override void _Ready() { UpdateWeights(); } public void EnterMouth(Node node) { try { RigidBody3D body = (RigidBody3D)node; if (body.Mass > MaxEatWeight) return; UpdateWeights(body.Mass); } catch (System.InvalidCastException) { // dont give a shit } } void UpdateWeights(float mass = 0f) { MaxEatWeight += (mass / MaxEatWeight) * EatGrowthFactor; ((XROrigin3D)GetParent()).WorldScale = 1.0f / MaxEatWeight; RightHand.Strength = MaxEatWeight; LeftHand.Strength = MaxEatWeight; } }