diff options
author | Mark Riedesel <mark@klowner.com> | 2021-10-11 10:16:48 -0400 |
---|---|---|
committer | Mark Riedesel <mark@klowner.com> | 2021-10-11 10:16:48 -0400 |
commit | 49a4d2bc490606baa22363c510b3bcd341f9fd1b (patch) | |
tree | 8b4bfbea4d4d58d495aa983aa664217b53baaa2a | |
parent | ceee1abc28a1a21b6908882709a3e1b5d3353492 (diff) |
add failure condition for get_pyramid_shape_rid() when camera3d is not in tree. fixes #53564
-rw-r--r-- | scene/3d/camera_3d.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 18b7bcc789..588d2b5018 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -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(); |