-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implement is_inside_solid_geometry()
in CharacterBody
#3066
Comments
The |
is_buried()
in CharacterBody
is_inside_solid_geometry()
in CharacterBody
Since I am not a native English speaker, I consider the ones you mentioned to be better. For now, I'll change it to |
That could be useful, but I would rather do it in a more generic way. Instead of a specific function, it should be possible to get the depth from any collision that occurred in your last character motion, by adding an extra function to The information is already there, just not exposed to script. I can make a PR next week, but if you'd like to try it yourself, it should be easy to do. You just need to add a new method That would allow your script to check if the depth is over a threshold and detect that your character is stuck. |
I confirmed that this can be solved with the API already in place. move_and_slide()
is_inside_solid_geometry = test_move(self.transform, Vector3.ZERO) However, if there is get_depth(), it can be used for post-penetration test resolution, so I will send a PR later. In fact, |
Describe the project you are working on
3D Character Game
Describe the problem or limitation you are having in your project
It is not possible to determine whether a
CharacterBody
is buried in objects or not. This means that it is not possible to get the object in which theCharacterBody
is buried.Describe the feature / enhancement and how it helps to overcome the problem or limitation
If a
CharacterBody
is buried in an object, you can disable the collision of the object by checkingis_inside_solid_geometry()
to prevent it from getting stuck.See also #3065.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a method to
CharacterBody
. I think it can be considered buried if the collision cannot be resolved after a user-set number of slides.If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
It needs to be included within the GodotPhysics
The text was updated successfully, but these errors were encountered: