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

To fix DLC scanner arm bug - ignore Colliders with triggers. #30

Open
Dunbaratu opened this issue May 20, 2021 · 0 comments
Open

To fix DLC scanner arm bug - ignore Colliders with triggers. #30

Dunbaratu opened this issue May 20, 2021 · 0 comments
Labels

Comments

@Dunbaratu
Copy link
Owner

For a long time LaserDist had a bug with the Breaking Ground DLC scanner arm parts, where the laser would pick up a hit on the invisible sphere around the scanner arm that the game uses to detect if rocks are in range or not.

It turns out this sphere is a trigger collider, which is not a "real" collider, in the sense the physics engine behaves as if it's not physically there - it doesn't bump into things. Instead it passes right through them with no effect, etc. The only purpose of a trigger collider is to fire off a callback hook to inform the programmer something is touching the collider, then the programmer does whatever they want with that information. The physics engine doesn't care about it.

This is why the scanner arm sphere is on layer 15 where the terrain should be. The sphere touches a terrain rock and the game responds to that trigger callback to learn that the rock is in range.

Physics.Raycast used to be unable to stop hitting trigger colliders back when LaserDist was first developed. But more recently it added a new parameter to Raycast that lets you specify if you would like it to ignore triggers. LaserDist could use that and fix a lot of headaches.

@Dunbaratu Dunbaratu added the bug label May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant