Skip to content

Instantly share code, notes, and snippets.

@v0xel1337
Created April 12, 2024 13:43
Show Gist options
  • Save v0xel1337/6b12d75a69475ad682770c84cdac931a to your computer and use it in GitHub Desktop.
Save v0xel1337/6b12d75a69475ad682770c84cdac931a to your computer and use it in GitHub Desktop.
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