var hit: RaycastHit2D = Physics2D.Raycast(transform.position, -Vector2.up);
if (hit != null) {
print(“hit object”);
}
I am very new to unity.
So basically this is a test. I need this to work to get what i want to work. So with my ray i want to cast it up from the player and hit a object. There is multiple problems i am having, first even when there is nothing in the area that is up it hits something. Second other code ive tried to use will hit my players collider, and only will work when i put it off put that causes even more er