// PlayerMovement// Rigidbody2D gravity and mass set to 2using UnityEngine;publicclassPlayerMovement: MonoBehaviour{ Rigidbody2D rb;float jumpForce =10f;float speed =4f;voidAwake()=>rb=GetComponent<Rigidbody2D>();voidStart(){rb.velocity=new Vector2(speed,rb.velocity.y);}voidUpdate(){if(Input.GetButtonDown("Fire1"))Jump();}voidJump()=>rb.velocity+=new Vector2(0f,jumpForce);}
using UnityEngine;publicclassCameraFollow: MonoBehaviour{[SerializeField] Transform target; Vector3 offset; Vector3 tempPos;voidStart()=>offset=transform.position-target.position;voidLateUpdate(){if(target!=null){tempPos=target.position+offset;tempPos.y=0f;transform.position=tempPos;}}}