- Home /
Javascript 2DRaycast help
Hi there, I'm working on a simple stealth game in unity2D, the very core gameplay will involve hiding from enemy sight as they look around. I'm relatively new to scripting and I've tried to find tutorials on how I'd do this, however the majority were in c#.
Basically I'd like a 2d raycast from an enemy that faces down, and switches between 2 positions. If the player walks into it, there's an event that's triggered. However there''s a crate between two of these points, and if the player is in front of the crate, the enemy is not alerted.
I hope this makes sense, and I appreciate all the help. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612102018im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Clicking on an Object to Make it the Variable Target 1 Answer
How do I register damage from the actual sword? not Raycast 1 Answer
Changing position of a RayCast 1 Answer
Convert c# to Js? 1 Answer
[SOLVED] Only instantiating once 1 Answer