Hello everyone, I am learning about Raycasting and I was wondering if there was a way to use it to detect enemies within a range. My thoughts would be to set up the enemy to have a variable that the play character searches and if the value is above a certain amount it would attack or trigger something like the start of a battle. (Que battle Music, Draw Command HUD, Draw Party HUD, etc). The game I am designing is more of an Action RPG and I am inspired by Final Fantasy 15 and Kingdom Hearts.
My goal is to place a sphere component over the Player’s head and Raycast from there in order to determine if what the character’s actually looking at is an enemy.
Another thing is, if the above is possible, is there a way I could make something catch the character’s attention? So maybe he runs by a home, and his head turns to it? (Not full Body)
I think that would help make exploration more real, as well as battles, and more.