private void OnCollisionExit(Collision collision) { TagsExtended collTags = collision.gameObject.GetComponent <TagsExtended>(); if (collTags == null) { return; } if (collTags.HasTag(TagsExtended.Tags.FLOOR)) { onFloor = false; } }
private void OnCollisionExit(Collision collision) { if ((playerComp.playerFlags & PlayerComp.c_MOUNTED) == 0) { TagsExtended collTags = collision.gameObject.GetComponent <TagsExtended>(); if (collTags == null) { return; } if (collTags.HasTag(TagsExtended.Tags.FLOOR)) { onFloor = false; } } }
private void OnCollisionStay(Collision collision) { TagsExtended collTags = collision.gameObject.GetComponent <TagsExtended>(); if (collTags == null) { return; } if (collTags.HasTag(TagsExtended.Tags.FLOOR)) { YPosAtJump = -99; RaycastHit hit; if (Physics.Raycast(transform.position, -transform.up, out hit, .1f)) // check if the floor is below you, so you can't jump on walls { onFloor = true; } } }