public partial class Item : RigidBody3D { [Export] public Vector3I Size { get; set; } public virtual Node3D Model => GetNode("Model"); public override void _Ready() { // TODO: Find a better way to better import models with colliders. // TODO: Import items dynamically at runtime? // TODO: Use PostImport tool script? foreach (var body in FindChildren("*", "StaticBody3D").Cast()) { foreach (var shape in body.GetChildren().OfType()) { body.RemoveChild(shape); AddChild(shape); } body.GetParent().RemoveChild(body); } // Set the collision properties here so we don't have to specify them in each item scene separately. CollisionLayer = (uint)(PhysicsLayer.Item | PhysicsLayer.Pickup); CollisionMask = (uint)(PhysicsLayer.Static | PhysicsLayer.Dynamic | PhysicsLayer.Player | PhysicsLayer.Item); Freeze = FindParent("Grid") != null; } }