Commit cd3d40da authored by Sebastian Frey's avatar Sebastian Frey
Browse files

fixed Kollision von Player und Element

parent fd2d01cd
......@@ -91,7 +91,7 @@ CapsuleCollider2D:
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
......
......@@ -20,7 +20,7 @@ namespace _Game.Scripts.Player
private void OnTriggerEnter2D(Collider2D other)
{
if (!other.CompareTag("Element")) return;
if (other.gameObject.layer != 10) return;
Debug.Log("Entered Collider of " + other.name);
_currentObject = other.gameObject;
_targetScript = _currentObject.GetComponent<InteractionObject>();
......@@ -28,7 +28,7 @@ namespace _Game.Scripts.Player
private void OnTriggerExit2D(Collider2D other)
{
if (!other.CompareTag("Element")) return;
if (other.gameObject.layer != 10) return;
if (other.gameObject != _currentObject) return;
Debug.Log("Exited Collider of " + other.name);
_currentObject = null;
......
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