Question by
TylerDean3211 · Jun 20, 2016 at 08:37 AM ·
2dscripting problemtopdownrpgaction
2D TopDown Combat. How to damage enemy that player is facing?
The player only moves in up,down,left,right and I cant figure out how to read if player is facing an enemy? So far all I can do damage all enemies with the same tag. How would would I go about discovering if the player is facing an enemy or not?
Comment
Raycasting is the way to go and this tutorial will get you started.
Your answer
![](https://koobas.hobune.stream/wayback/20220612083306im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D Top Down Combat: How to only damage enemy that the player is facing? Up,down,left,right 1 Answer
What is the most effective way to structure Card Effects in a Single Player game? 1 Answer
Multiple Sprites, One Script, Randomization 1 Answer
Any one help me in this script? 0 Answers
Rotating weapon in top-down 2D 0 Answers