Commit bb11d4dc authored by mthiele2's avatar mthiele2

Erd-Gegner Vollidioten Script

parent dc20d0fc
This diff is collapsed.
fileFormatVersion: 2
guid: 32561bea78ffe5941b1379159c0b43b2
guid: 402871cf6f60f0b4398268f7095604a0
DefaultImporter:
externalObjects: {}
userData:
......
......@@ -6,12 +6,10 @@ public class isHittingWall : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log(collision.gameObject.layer + "stuff"+ LayerMask.NameToLayer("Ground"));
if (!(collision.gameObject.layer == LayerMask.NameToLayer("Ground") || collision.gameObject.layer == LayerMask.NameToLayer("Enemy")))
if (collision.gameObject.layer == LayerMask.NameToLayer("Ground") || collision.gameObject.layer == LayerMask.NameToLayer("Enemy"))
{
return;
this.GetComponentInParent<AI_WaterAttack>().turn();
}
this.GetComponentInParent<AI_WaterAttack>().turn();
}
//private void OnCollisionEnter2D(Collision2D collision)
......
......@@ -17,7 +17,8 @@ public class AI_WaterAttack : WeightedAction
void Start()
{
myAI = GetComponent<AI_Core>();
}
movingRight = true;
}
void CheckConditions()
{
......@@ -30,11 +31,12 @@ public class AI_WaterAttack : WeightedAction
RaycastHit2D groundInfo = Physics2D.Raycast(groundDetection.position, Vector3.down, distance, 1<<LayerMask.NameToLayer("Ground"));
if (groundInfo.collider == false)
if (!groundInfo.collider == false)
{
turn();
if(!groundInfo.collider.gameObject.CompareTag("Moving")) return;
}
}
turn();
}
public void turn()
{
......
......@@ -14,6 +14,7 @@ TagManager:
- EnemyShot
- DestroyableByFire
- Interactive
- Moving
layers:
- Default
- TransparentFX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment