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

first try implementing Shapecast for interaction detection. #277

Closed
wants to merge 6 commits into from

Conversation

Phazorknight
Copy link
Owner

@Phazorknight Phazorknight commented Sep 18, 2024

This is updating the Player scene and PlayerInteractionComponent to support a ShapeCast3D (instead of or in addition to the Raycast3D).

While it seems to work, it's behavior is currently not exactly what I expected in terms of how and where it detects interactable objects.

Phazorknight and others added 6 commits September 18, 2024 08:03
…hters to debug its behavior

This commit modifies the existing InteractionRaycast.gd and to a lesser extent the PlayerInteractionComponent.gd.

InteractionRaycast now uses a shapecast when the raycast doesn't hit a valid collider. If the shapecast hits multiple valid colliders it will use a 'hotspot' and judge distances between it and valid colliders to determine which object the player is more likely intending to pick up.

There is a known issue regarding the ShapeCast3D node reference being lost on scene change.
- Turned the Interaction Raycast into a packed scene, to keep child node structure consistent. This should fix reference issues with the Enemy using an interaction raycast.
- Updated the player and enemy packed scene to use said interaction raycast packed scene.
- Added the option to turn debug shapes on/off.
- Turn debug shapes off on ready if they're disabled and ensure they don't turn on any point while playing
- Removed a null ref check having to do with the ShapeCast3D not found for enemy interaction raycast on scene change
Interaction Ray + Shapecasting for easier object interaction
@Phazorknight Phazorknight deleted the phazor_wip branch September 22, 2024 21:50
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

Successfully merging this pull request may close these issues.

2 participants