Test Push Target

This commit is contained in:
AliIbnAbiTalib
2023-04-06 23:06:41 +02:00
parent fe220c4e4e
commit 840bc3b7a5
3 changed files with 12 additions and 7 deletions
@@ -172,13 +172,16 @@ public class PlayablePlayer : Player
//Der Spieler steht gerade
else
{
if (currentField.placedItem != null)
if (currentField != null)
{
Trap t = currentField.placedItem.GetComponent<Trap>();
AddCoins(-3);
t.target.AddCoins(3);
Destroy(t);
currentField.placedItem = null;
if (currentField.placedItem != null)
{
Trap t = currentField.placedItem.GetComponent<Trap>();
AddCoins(-3);
t.target.AddCoins(3);
Destroy(t);
currentField.placedItem = null;
}
}
Vector3 currentRotation = Quaternion.ToEulerAngles(transform.rotation);
currentRotation.y = -34;