Hi, I have a script that goes the following
public bool IsTouchingGround;
public int speed = 5;
public LayerMask ground;
public Transform GroundCheck;
public float GroundCheckRadius;
Jump();
Vector3 movement = new Vector3(Input.GetAxis(“Horizontal”), 0f, 0f);
transform.position += movement * Time.deltaTime * speed;
IsTouchingGround = Physics2D.OverlapCircle(GroundCheck.position, GroundCheckRadius, ground);
public void Jump()
{
if (Input.GetButtonDown(“Jump”) && (IsTouchingGround))
{
GetComponent().AddForce(new Vector2(0f, 7f), ForceMode2D.Impulse);
}
}
And camera script
public bool cmr = true;
public Transform Player;
// Update is called once per frame
private void LateUpdate()
{
{
if (cmr == true)
{
gameObject.transform.position = new Vector3(Player.position.x, Player.position.y, Player.position.z - 10);
}
}
}
}
When my player collides with any colliders it starts shaking a lot and its very annoying. Thanks