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

Issue with simulate on _physics_process using move_and_slide_with_snap #22

Open
DannyDarwiche opened this issue Jul 6, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@DannyDarwiche
Copy link
Collaborator

DannyDarwiche commented Jul 6, 2021

Description of issue

When using the simulate function the tests can pass but multiple errors will generate inside of the console window. This is likely tied to the fact that the built-in function move_and_slide_with_snap is being used inside our _physics_process. An attempted solution was to make the object being tested, the player controller, be a partial double and to stub the move_and_slide_with_snap function so that it returns a unit vector. This presented a new issue however being that the move_and_slide_with_snap expects to assign a variable with its return value, which in this case is the velocity being tested. This meant that the velocity variable being asserted was always equal to the unit vector instead of the expected values. It would be useful if a stubbed function could be set to return the passed in value.

Click for image.

Testing_with_simulate

@DannyDarwiche DannyDarwiche added the enhancement New feature or request label Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant