Log in with itch.io to leave a comment.
Ayus use this code to get a perfect geometry dase
usingUnityEngine;
usingSystem.Collections;
publicclassPlayerController:MonoBehaviour{
publicfloat speed;
publicfloat jumpPower;
privateRigidbody2D body2d;
privatebool grounded=false;
// Use this for initialization
voidStart(){
body2d=<span class="kwd" <this<="" span="">>span class="pun">.</span>GetComponent<Rigidbody2D>();
}
// Update is called once per frame
voidFixedUpdate(){
body2d.velocity=Vector2.right* speed;
if(Input.GetMouseButton(0)&& grounded)
{
body2d.AddForce(Vector2.up* jumpPower);
}
}
privatevoidOnCollisionStay2D(Collision2D collision)
{
if(collision.gameObject.tag=="ground")
{
grounded=true;
}
}
privatevoidOnCollisionExit2D(Collision2D collision)
{
if(collision.gameObject.tag=="ground")
{
grounded=false;
}
}
Note: Searched internet for hours and finally get it i will give the link to https://answers.unity.com/questions/1194202/jump-like-geometry-dash-game.html. Bring it on next update and yeah thank me later. Love from India