Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(detector): fix player detection by guards and cameras #19

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

olivierperez
Copy link
Member

@olivierperez olivierperez commented Aug 19, 2024

I've implemented a new Detector mechanism which is used by cameras and guards to check if they can see the player.

Description

This Detector remembers if player is still in the detection area until he gets out. On each _process call, if player is still in the area, it will trigger a raycast to check if it sees the player and emit a signal when it does.

Motivation and Context

There was a bug when player entered the detection area while partially hidden behind a wall. At this point we didn't detect him and that's what expected, but this issue was if the player, while staying in the detection area, goes fully in front of camera/guard and wasn't detected.

How has this been tested?

I've altered levels to make this cases simpler to test, and I've reset them.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@olivierperez olivierperez added Type: Bug Something isn't working as expected. Status: Awaiting Review Ready for review. labels Aug 19, 2024
@olivierperez olivierperez changed the title fix(detector): fix player detection by fix(detector): fix player detection by guards and cameras Aug 29, 2024
AnthoMarquet
AnthoMarquet previously approved these changes Sep 2, 2024
Copy link
Contributor

@AnthoMarquet AnthoMarquet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olivierperez J'aurai plutot nommé detector_area la variable pour avoir quelque chose de plus uniforme. On a souvent suffixé par le type de node. Bref un mini détail :)

Test concluant après avoir adapté un niveau pour faire le test.

@olivierperez olivierperez force-pushed the fix/detection_not_working_sometimes branch from 52c0dd4 to b72f196 Compare September 2, 2024 20:49
@olivierperez
Copy link
Member Author

@AnthoMarquet Corrigé b72f196 (#19)

@AnthoMarquet AnthoMarquet merged commit 250f2b1 into main Sep 3, 2024
@AnthoMarquet AnthoMarquet deleted the fix/detection_not_working_sometimes branch September 3, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Review Ready for review. Type: Bug Something isn't working as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants