Merge pull request #53676 from Klowner/camera-get-pyramid-rid-shape-crash

Fix Camera3D::get_pyramid_shape_rid() crash when not in scene
This commit is contained in:
Rémi Verschelde 2021-10-12 22:32:16 +02:00 committed by GitHub
commit b372f79dd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -656,6 +656,7 @@ Vector3 Camera3D::get_doppler_tracked_velocity() const {
}
RID Camera3D::get_pyramid_shape_rid() {
ERR_FAIL_COND_V_MSG(!is_inside_tree(), RID(), "Camera is not inside scene.");
if (pyramid_shape == RID()) {
pyramid_shape_points = get_near_plane_points();
pyramid_shape = PhysicsServer3D::get_singleton()->convex_polygon_shape_create();