diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/gi_probe.cpp | 2 | ||||
-rw-r--r-- | scene/3d/gpu_particles_3d.cpp | 1 | ||||
-rw-r--r-- | scene/3d/mesh_instance_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/ray_cast_3d.cpp | 2 |
4 files changed, 4 insertions, 3 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 4d7fc29f15..6505fb1ee8 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -454,7 +454,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { mmi->set_multimesh(baker.create_debug_multimesh()); add_child(mmi); #ifdef TOOLS_ENABLED - if (get_tree()->get_edited_scene_root() == this) { + if (is_inside_tree() && get_tree()->get_edited_scene_root() == this) { mmi->set_owner(this); } else { mmi->set_owner(get_owner()); diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index 5339b8a8da..50044ddc67 100644 --- a/scene/3d/gpu_particles_3d.cpp +++ b/scene/3d/gpu_particles_3d.cpp @@ -613,6 +613,7 @@ void GPUParticles3D::_bind_methods() { GPUParticles3D::GPUParticles3D() { particles = RS::get_singleton()->particles_create(); + RS::get_singleton()->particles_set_mode(particles, RS::PARTICLES_MODE_3D); set_base(particles); one_shot = false; // Needed so that set_emitting doesn't access uninitialized values set_emitting(true); diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 27d5487a1a..c495f68890 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -427,7 +427,7 @@ void MeshInstance3D::create_debug_tangents() { add_child(mi); #ifdef TOOLS_ENABLED - if (this == get_tree()->get_edited_scene_root()) { + if (is_inside_tree() && this == get_tree()->get_edited_scene_root()) { mi->set_owner(this); } else { mi->set_owner(get_owner()); diff --git a/scene/3d/ray_cast_3d.cpp b/scene/3d/ray_cast_3d.cpp index 95638ce514..475f8c07fd 100644 --- a/scene/3d/ray_cast_3d.cpp +++ b/scene/3d/ray_cast_3d.cpp @@ -428,7 +428,7 @@ void RayCast3D::_update_debug_shape_material(bool p_check_collision) { color = get_tree()->get_debug_collisions_color(); } - if (p_check_collision) { + if (p_check_collision && collided) { if ((color.get_h() < 0.055 || color.get_h() > 0.945) && color.get_s() > 0.5 && color.get_v() > 0.5) { // If base color is already quite reddish, highlight collision with green color color = Color(0.0, 1.0, 0.0, color.a); |