0 votes

How would I detect if a Vector3 is inside a shape?

I see many solutions for 2D physics, but I can't find a solution for 3D physics.

Is there something like Geometry.IsPointInPolygon but for 3D Shapes instead?

I'm only using BoxShapes, although they are being rotated and scaled so using AABB isn't a viable solution (unless there's something I'm missing)

I've been at this for far too long now and decided it best to just ask

Godot version v3.4.2.stable.mono.official [45eaa2daf]
in Engine by (16 points)

1 Answer

0 votes

A "simple" solution is to use a raycast from your Vector3 to any direction with a length as close to zero as possible.

by (1,342 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.