raycasthit2d unity
RaycastHit2D hit = Physics2D.Raycast(transform.position, -Vector2.up);
raycasthit2d unity
RaycastHit2D hit = Physics2D.Raycast(transform.position, -Vector2.up);
raycasthit unity
RaycastHit hit;
/*
(Vector3) hit.point - the point where the ray has collided.
(Quaternion) hit.normal - the normal of the GameObject the ray has collided.
(float) hit.distance - the distance between the ray origin and hit.point.
(Transform) hit.transform - the transform of the GameObject the ray has hit
(Rigidbody) hit.rigidbody - rigidbody attached to GameObject ray collided,
if no rigidbody is attached, value is null.
(Vector2) hit.textureCoord - the coordinate of the point on the texture
of the GameObject the ray collided.
*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us