made weapon into a dependant and used new forgeneitty node as a node3d

This commit is contained in:
2026-05-02 16:13:23 +02:00
parent 0e6211943d
commit 852f265b9f
8 changed files with 108 additions and 69 deletions

View File

@@ -1,6 +1,5 @@
// Copyright © Gamesmiths Guild.
using System;
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Gamesmiths.Forge.Core;
@@ -12,14 +11,13 @@ using Gamesmiths.Forge.Godot.Resources;
using Gamesmiths.Forge.Statescript;
using Gamesmiths.Forge.Tags;
using Godot;
using Node = Godot.Node;
namespace Movementtests.tools;
[GlobalClass]
[Icon("uid://cu6ncpuumjo20")]
[Meta(typeof(IAutoNode))]
public partial class ForgeEntityNode : Node, IForgeEntity
public partial class ForgeEntityNode : Node3D, IForgeEntity
{
public override void _Notification(int what) => this.Notify(what);

View File

@@ -29,7 +29,8 @@ public class ExplodingSwordBehavior(PackedScene explosion, float radius) : IAbil
return;
}
explo.Radius = radius;
GD.Print("explosion");
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explo);
explo.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);