diff --git a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml
index 5077f5c..d078b85 100644
--- a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml
+++ b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml
@@ -5,6 +5,7 @@
+
@@ -12,6 +13,7 @@
+
@@ -152,7 +154,7 @@
-
+
diff --git a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs
index e87c588..dd1fbf7 100644
--- a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs
+++ b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs
@@ -176,7 +176,7 @@ public class NoPlayablePlayer : Player
Trap t = currentField.placedItem.GetComponent();
AddCoins(-3);
t.target.AddCoins(3);
- Destroy(t);
+ Destroy(t.gameObject);
currentField.placedItem = null;
}
}
diff --git a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs
index 8de58d6..7db7bd1 100644
--- a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs
+++ b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs
@@ -178,8 +178,9 @@ public class PlayablePlayer : Player
{
Trap t = currentField.placedItem.GetComponent();
AddCoins(-3);
+ Debug.Log(t.name);
t.target.AddCoins(3);
- Destroy(t);
+ Destroy(t.gameObject);
currentField.placedItem = null;
}
}
@@ -375,7 +376,7 @@ public class PlayablePlayer : Player
currentField.placedItem = items[index];
GameObject temp = Instantiate(items[index].gameObject);
Trap t = temp.GetComponent();
- t.target = this;
+ t.target = gameObject.GetComponent();
temp.transform.position = currentField.transform.position + (Vector3.up / 2);
activeItem = Item.Type.None;
}
diff --git a/FlufflParty/Assets/Scripts/Players/Player.cs b/FlufflParty/Assets/Scripts/Players/Player.cs
index 0e1fc70..54166af 100644
--- a/FlufflParty/Assets/Scripts/Players/Player.cs
+++ b/FlufflParty/Assets/Scripts/Players/Player.cs
@@ -111,7 +111,7 @@ public abstract class Player : MonoBehaviour
currentField.placedItem = items[index];
GameObject temp = Instantiate(items[index].gameObject);
Trap t = temp.GetComponent();
- t.target = this;
+ t.target = gameObject.GetComponent();
temp.transform.position = currentField.transform.position + (Vector3.up / 2);
activeItem = Item.Type.None;
}