Skip to content

Commit

Permalink
XRToolsStaging: warns if no Fade is added as a child
Browse files Browse the repository at this point in the history
XRToolsStaging requires a MeshInstance3D to hold a transition
fade. This adds a new property so the user is warned
to add this node to staging.

Fix issue GodotVR#629
  • Loading branch information
esodan committed Apr 1, 2024
1 parent dd24895 commit 58385c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/godot-xr-tools/staging/staging.gd
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ func load_scene(p_scene_path : String, user_data = null) -> void:
## unless hidden.
func set_fade(p_value : float):
if p_value == 0.0:
$Fade.visible = false
fade.visible = false
else:
var material : ShaderMaterial = $Fade.get_surface_override_material(0)
var material : ShaderMaterial = fade.get_surface_override_material(0)
if material:
material.set_shader_parameter("alpha", p_value)
$Fade.visible = true
fade.visible = true


func _add_signals(p_scene : XRToolsSceneBase):
Expand Down

0 comments on commit 58385c9

Please sign in to comment.