Spawn rescued item at correct location and enable pickup
This commit is contained in:
@@ -25,14 +25,15 @@ namespace GameJamDungeon
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
ContactMonitor = true;
|
||||
BodyEntered += DroppedItem_BodyEntered;
|
||||
GlobalPosition = Game.Player.GlobalPosition + Vector3.Up;
|
||||
Sprite.Texture = Item.Info.Texture;
|
||||
AddCollisionExceptionWith((Node)Game.Player);
|
||||
}
|
||||
|
||||
public async void Drop()
|
||||
{
|
||||
AddCollisionExceptionWith((Node)Game.Player);
|
||||
GlobalPosition = Game.Player.GlobalPosition + Vector3.Up;
|
||||
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * 5.0f);
|
||||
await ToSignal(GetTree().CreateTimer(1.5), "timeout");
|
||||
RemoveCollisionExceptionWith((Node)Game.Player);
|
||||
|
||||
Reference in New Issue
Block a user