- Home /
Question by
TheRichardGamer · Dec 21, 2014 at 09:23 PM ·
2dphysicsraycastray
HOW DO I USE RAYCASTHIT 2D????
I can't use Raycast Hit 2d in my game and I need it but the function won't take it!!!
WHAT DO I DO?
Here's my script:
RaycastHit2D hit;
if(Physics2D.Raycast(this.gameObject.transform.position, Vector2.right, groundDistance / 100, out hit))
{
}
Comment
Answer by Bunny83 · Dec 21, 2014 at 09:28 PM
Physics2D.Raycast works differently from Physics.Raycast. So check the example in the docs.
Your answer
Follow this Question
Related Questions
Physics.Raycast intermittently stops working 1 Answer
Linecast, rotate end point relative to objects rotation 1 Answer
2D Slope acceleration 1 Answer
Ray effect on sprite with obstacles 0 Answers