public sealed class PhysBullet : Component, Component.ICollisionListener { [Property] public Collider collider { get; set; } [Property] public Rigidbody BRigidbody { get; set; } protected override async void OnStart() { if ( collider != null ) { collider.OnTriggerEnter += OnTriggerEnter; } await Task.DelaySeconds( 5 ); GameObject.Destroy(); } protected override void OnUpdate() { } async void ICollisionListener.OnCollisionStart( Collision collision ) { await Task.DelaySeconds( 1 ); GameObject.Destroy(); } // var a= Scene.Trace.Ray( collision.Contact.Point, collision.Contact.Point + collision.Contact.Normal * 10 ).Run(); // Log.Info(collision.Other.GameObject); // Log.Info(a.GameObject); // DebugOverlay.Line(a.StartPosition,a.EndPosition, duration: 5.5f); // DestroyGameObject(); public void OnTriggerEnter( Collider other ) { var components = other.Components; if ( components.TryGet( out var controller ) ) { if ( Network.IsOwner ) return; controller.Enabled = true; // ModelHitboxes sas = controller.Components.Get(); // collider.FindClosestPoint(other.WorldPosition); // var d = controller.GameObject.GetComponent(); // // d.Controller.Velocity = Vector3.Up * 2500; // rb.MassOverride = 500f; // // rb.ApplyImpulse( Vector3.Up * 5000000 ); // rb.Destroy(); // controller.bodyPhysics. } } }