-
Notifications
You must be signed in to change notification settings - Fork 117
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
Make interactions be blocked by Environment safely #114
Conversation
I was going to add an exported check to the Player controller to adjust this, but I realized it's probably better to let devs adjust the layering system themselves to suit their needs. I think this is good for a default, and if devs want something else then it's very simple to change back or make work in other ways without being too prescriptive. |
Not sure if this is needed? Issue #110 is caused by the walls not set on collision layer 2. Setting them to layer 2 fixes it, so I'd personally not change any existing layer structures on the player interaction component, especially since it would force users to update the collision layers on all their interactive objects. But I'd be happy to hear of any other advantages that I might not be aware of. |
As it is right now, in the Project Settings of the Cogito Godot project is Layer 1 is defined as "Environment", and Layer 2 is defined as "Interactables". To me it seems conflicting to have to make all your environment pieces "Interactables" to be physically blocking interactions. So I don't see that it would be a good idea to have users be moving all of their environment that is not literally Interactable onto the Interactables layer just to get this feature out of the environment. All I've done in the PR is move the player on to its own layer so that way the interaction raycast can't hit it, and include Environment as a collision layer for the raycast to have environment block interactions. Unless this layer setup is no longer of interest, at which point the layer names should probably be changed. Though personally, I would prefer environmental pieces on the default layer 1 to be blocking interactions. Also by not encouraging the separation of these layers, then you would have no way to discern Interactables vs Environment purely via Raycast if you did want interactions to work through walls, you have to do the raycast, then check if what it hit is in the group. |
That makes sense! |
Hey @FailSpy , when I open this on my end, playtesting the project makes my resolution all pixely, no matte which one I select from the options + the temp UI scaling slider is gone. Could you take a look to undo any changes to those in this PR? I'd try to cherrypick, but with the update layersettings I'd like to keep the project.godot file from this PR. |
Oh those changes weren't included cause that PR wasn't merged when I started the |
@Phazorknight give it a try now? |
Oh wait, hold off. Found a major issue with the layering setup: bunch of stuff now doesn't collide with the player. Attempting a workaround that minimizes breakage of other people's existing work... |
5ac35fa
to
1170154
Compare
@Phazorknight
EDIT: Force-pushes cleans up commits into one commit, considering the original commit for this branch was basically completely undone. |
1170154
to
a51f13b
Compare
a51f13b
to
b697995
Compare
@Phazorknight Okay, properly ready now to be pulled in. Give it a shot, see how it goes for you. |
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.
Seemed good on my end! Gonna approve.
Thank you so much for this!
This one's pretty self-explanatory. Resolves #110