Question by
Quast · Oct 11, 2020 at 03:54 AM ·
c#unity 2draycasthit2d
RayCast 2d change start position ?
Hi, I need to be able to change the position of start rayCast position. I'n my case the rayCast start from the middle of the object and goes down. I need it starts far from middle position.
RaycastHit2D hitDown = Physics2D.Raycast(transform.position, Vector2.down);
if (hitDown.collider != null)
{
Debug.DrawRay(this.transform.position, Vector2.down * 1, Color.yellow);
Debug.Log("Did Hit down: " + hitDown.collider.name);
}
Comment
Your answer
Follow this Question
Related Questions
Highscore not working 0 Answers
Instanciated objects can only be seen if they were instanciated while looking to the left. 0 Answers
Calculate BoxCollider2D based on the actual player sprite 2 Answers
Unable to save the captured photo in hololens app. 0 Answers
How to change the position of a Raycast (on Center of the Player 2D)? 0 Answers