Created
April 12, 2024 13:43
-
-
Save v0xel1337/6b12d75a69475ad682770c84cdac931a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hits = Physics.RaycastAll(_lastPos, Vector3.Normalize(transform.position - _lastPos), Vector3.Distance(_lastPos, transform.position)); | |
_lastPos = transform.position; | |
for (int i = 0; i < hits.Length; i++) | |
{ | |
if (hits[i].transform.tag == "Ground" && rb.velocity.y < 0) | |
{ | |
this.transform.position = hits[i].point; | |
JumpLand.Play(); | |
rb.velocity = Vector3.zero; | |
rb.AddForce(Vector3.up * (equipData.boostLvL * 8f + 500) * hits[i].transform.gameObject.GetComponent<GroundBounce>().boostSize); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment