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

Enemy flips multiple times when detecting wall #13

Closed
Bolza opened this issue Dec 30, 2020 · 1 comment
Closed

Enemy flips multiple times when detecting wall #13

Bolza opened this issue Dec 30, 2020 · 1 comment

Comments

@Bolza
Copy link
Owner

Bolza commented Dec 30, 2020

  • What is it:
    The enemy flips when finding wall, another check happens before the rays are re-drawn in front, enemy flips again and so on...
    EnemyState.PhysicsUpdate (all checks done here)
    IdleState.Exit() -> Flip()
    Skeleton_TargetDetectedState->LogicUpdate() -> if (targetDetectedBackward) entity.Flip();

  • How to debug it:
    The problem is Flip() happens when it should not and /or wall is detected when is not.
    So Debug.Log or Breakpoint in those functions should do

  • How to fix it:
    Move checks in EnemyState.LogicUpdate

@Bolza
Copy link
Owner Author

Bolza commented Dec 30, 2020

Move checks in EnemyState.LogicUpdate

@Bolza Bolza closed this as completed Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant