-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improved tutorials/physics/ray-casting tutorial. #7813
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
Conversation
|
Thank you for your contribution! Please convert the image to the |
|
Can you please squash your commits into one, see here |
Fixed a code-tab in the Ray-casting tutorial. It's also lacking a C# example, but I don't know how to write C#.
| func _physics_process(delta): | ||
| var space_state = get_world_2d().direct_space_state | ||
| var query = PhysicsRayQueryParameters2D.create(global_position, enemy_position) | ||
| var query = PhysicsRayQueryParameters2D.create(global_position, player_position) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for using player_position here but target_position below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tutorial provides a specific-use case example (enemy & player), so i thought it would be a good idea to use more 'generalized' wording there to hint at other use-cases outside of those situations.
|
Please use rebase to update your branch, see here, it avoids having to squash again and keeps cleaner history |
Im not really sure how to do that. I've tried doing this : but it throws an error and I have no clue how to fix it. I don't want to accidentally nuke everything. |
|
I think it would be easier for me to make a new PR, ive put it here |


Fixed this error :

It's still lacking a C# code example, but I don't know C#. Could a C# user please write one?
I decided to replaced the old false-positive example image, let me know if I need to change anything.
I've also made the last code examples a little more generic, replacing 'enemy_position' with 'target_position'.