I want to toggle visibility of some mesh in certain distance. However toggling visible doesn't working at all. Here's the structure of my object:
Spatial
- Mesh 1
- Mesh 2
And here's the code:
var distance = ...
if distance < 100:
$Mesh1.visible = true
$Mesh2.visible = false
else:
$Mesh1.visible = false
$Mesh2.visible = true
But when I run the game, always $Mesh1 is visible. How do I change visibility of mesh? Using Godot 3.1.1