- Home /
Question by
juanda999games · Sep 10, 2021 at 10:49 PM ·
raycast2d-platformer2d-physicslayermask
I have a problem with Layermask Unity2D
I have a problem with RayCast 2d, i select a specific layer to detect collisions in the inspector, but when i write the Raycasting function it dont detect the layer´.
RaycastHit2D hit = Physics2D.Raycast(transform.position,transform.right * rayDistance, rayDistance,LayerMask.NameToLayer("Death"));
canJump = Physics2D.Raycast(new Vector2(transform.position.x + 2, transform.position.y),-transform.up,1,deathLayer);
Comment
Your answer
Follow this Question
Related Questions
Use 2D Effectors with Raycast Collision Method 0 Answers
[2D] How to move an object along a Raycast and over a set period of time? 1 Answer
How to flip 2d character walk movement? 3 Answers
Create a little time pause just after jumping 2 Answers
Having some stuck issues on the 2D infinite runner 0 Answers