mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 17:15:53 +00:00
Camera fix and broken
This commit is contained in:
parent
91fcd73688
commit
dd9c666995
10 changed files with 202 additions and 139 deletions
|
|
@ -98,7 +98,7 @@ public partial class CameraPlayerDetection : PlayerDetection
|
|||
// Perform raycast
|
||||
var spaceState = GetWorld2D().DirectSpaceState;
|
||||
var query = PhysicsRayQueryParameters2D.Create(GlobalPosition, rayEnd);
|
||||
query.Exclude = new Godot.Collections.Array<Rid> { GetRid() };
|
||||
query.Exclude = [GetRid()];
|
||||
query.CollideWithAreas = true;
|
||||
query.CollideWithBodies = true;
|
||||
query.CollisionMask = collisionMask;
|
||||
|
|
@ -114,7 +114,6 @@ public partial class CameraPlayerDetection : PlayerDetection
|
|||
if (colliderNode is InteractionController interactionController && interactionController == _cachedPlayer)
|
||||
{
|
||||
detected = true;
|
||||
// Handle detection logic here
|
||||
}
|
||||
// Adjust debug line to collision point
|
||||
debugLineEnd = (Vector2)result["position"];
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public partial class Enemy : CharacterBody2D
|
|||
[Export] public Node2D DefeatScript;
|
||||
|
||||
[Export] public AiState Ai { get; private set; }
|
||||
|
||||
[Export] public PackedScene CorpseTemplate { get; private set; }
|
||||
|
||||
protected float _currentHealth = 0f;
|
||||
|
||||
|
|
@ -268,9 +270,17 @@ public partial class Enemy : CharacterBody2D
|
|||
ActivateDefeatScript();
|
||||
}
|
||||
//CreateParticles();
|
||||
//CreateDebris();
|
||||
CreateDebris();
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
private void CreateDebris()
|
||||
{
|
||||
if (CorpseTemplate is not null)
|
||||
{
|
||||
this.CreateSibling<Node2D>(CorpseTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ActivateDefeatScript()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue