This commit is contained in:
allylikesfrogs
2023-05-04 13:53:37 -07:00
parent 7070b33ad3
commit 96acb9ba5f
5 changed files with 78 additions and 77 deletions

View File

@@ -2,6 +2,8 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// MIGHT NOT NEED THIS LOL
public class WaterBehavior : MonoBehaviour
{
public Rigidbody2D RB;
@@ -15,7 +17,7 @@ public class WaterBehavior : MonoBehaviour
private void Bounce()
{
RB.velocity = new Vector2(RB.velocity.x, -(RB.velocity.y));
RB.AddForce(RB.velocity * bounceForce, ForceMode2D.Impulse);
/*RB.velocity = new Vector2(RB.velocity.x, -(RB.velocity.y));
RB.AddForce(RB.velocity * bounceForce, ForceMode2D.Impulse);*/
}
}

View File

@@ -222,6 +222,11 @@ public class PlayerBehavior : MonoBehaviour
}
}
void Bounce()
{
}
void OnTriggerEnter2D(Collider2D col)
{
if (col.tag == "grappleSurface")
@@ -243,6 +248,10 @@ public class PlayerBehavior : MonoBehaviour
this.playerController.in_range = true;
this.playerController.enemy = col.transform.parent.gameObject;
}
else if (col.tag == "bouncy")
{
Bounce();
}
}
void OnTriggerExit2D(Collider2D col)