diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-12 22:32:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 22:32:16 +0200 |
commit | b372f79dd52860c3514bab7652ca895c1eec8ed9 (patch) | |
tree | 5ec6d16784fa060bacb97a3fa7e5532a225fcd41 /scene/3d | |
parent | 88463c3eee630ba780556918294744ba7125c94b (diff) | |
parent | 49a4d2bc490606baa22363c510b3bcd341f9fd1b (diff) |
Merge pull request #53676 from Klowner/camera-get-pyramid-rid-shape-crash
Fix Camera3D::get_pyramid_shape_rid() crash when not in scene
Diffstat (limited to 'scene/3d')
-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(); |