Enemy Sight , Aggro and hitbox and hurtbox, and camera devlog of this week:
Enemy Sight
Enemy Sight Detector:
Enemies have a green vision cone (check it out in the images!) that detects the player when they enter its range. But it’s not just about stepping into the cone there’s a wall detector raycast that checks for obstacles like walls. If there’s a wall between you and the enemy, they won’t spot you, making stealth a real possibility!
Enemy Attack Area:
Once the player gets too close and enters the attack area (with no obstacles in the way), the enemy locks on and tries to attack. This makes positioning in combat super important.
Chase Alert Area:
When an enemy’s aggro is triggered, their field of view expands, and they’ll keep chasing you as long as you’re in this larger area. If you stay in range, the aggro renews, so you’ll need to break line-of-sight or escape to shake them off!
Wall Detector Raycast:
This raycast is active whenever the player enters the sight or attack areas, ensuring enemies only react if they have a clear line to you. It’s a small detail, but it makes the AI feel smarter and more realistic.
Raycast for cliff and wall detection for chase / partrol states:
There's also 2 raycast responsible to detect walls and cliffs for the chase state and patrol states, if the enemy detects a cliff or a wall it wont chase the player through it and if its patrolling it will turn around and patrol again to the other direction
Hitbox and Hurtbox Mechanics:
Enemies and players now have hurtboxes (for attacks) and hitboxes (for receiving damage) that are fully functional. When an attack connects, the system checks for collisions, and a raycast ensures there’s no obstacle (like a wall) between the attacker and target. This prevents attacks from magically hitting through walls!, hurboxes activates in certan frames of any animation that i want to.
Camera
Also i updated the camera logic again, i've been playing some silksong and then i realized my camera vertical offset logic wasnt ideal, but now instead of janky bars that follows the players it will ofset based on the direction the sprite is facing
What’s Next?
The detection is working great, but I’m now focusing on adding damage states for characters (health bars, damage animations) and implementing mechanics like knockback, and other parameters to make combat feel dynamic.I’m tweaking these systems to balance challenge and making the game as fun as i can