BoxCast
RaycastHit2D hit = Physics2D.BoxCast(transform.position, new Vector2(0.99f, 0.1f), 0f, Vector2.down, 0.5f, groundLayer); void OnDrawGizmos() { Gizmos.color=Color.red; Gizmos.DrawCube(transform.position-transform.up * 0.5f, new Vector2(0.99f, 0.1f)); } using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { Rigidbody2D rigid; SpriteRend..
2023.02.21