![]() Gizmos.DrawWireSphere(feetPos. (Dwg), Cutout, Illustration (Psd), Adobe Photoshop / Illustrator Brush. ABR filesLicense: Free for personal and commercial useFile Size: 11.6 KBDownload file type: ZipAuthor: Show. File Info: Dimensions: 250 pixelAvailable Format. PSD templates, Text Effects, Mockups, Plugins. always applied if not grounded if (!isGrounded)īool isGrounded = Physics2D.OverlapCircle(feetPos.position, checkRadius, whatIsGround) The Top Free Photoshop Files from the web. ![]() Rb.velocity += Vector2.up * (-lowJumpMultiplier) If (rb.velocity.y 0 & !Input.GetButton( "Jump")) // if is going up and not pressing button, force down Rb.velocity = new Vector2(hor * speed, rb.velocity.y) GetComponent().velocity = Vector2.up * jumpVelocity If (Input.GetButtonDown( "Jump") & isGrounded) ![]() IsGrounded = Physics2D.OverlapCircle(feetPos.position, checkRadius, whatIsGround) Public LayerMask whatIsGround // what is floor? public Transform feetPos // where the isGrouded OverlapCircle is positioned public float checkRadius // the radious of OverlapCircle bool isGrounded // if its grounded or not private void Start() public float jumpVelocity // velocity set for the jump public float fallMultiplier = 2.5f // force that inflences when the player is falling public float lowJumpMultiplier = 2f // force that influences when the player is going up withot pressing the button float hor Public float speed = 5 // Horizontal speed to move public float gravity = - 5 // force that influences when jumping (going up with button, going up without button, falling) // this force stops the jump for going up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |