This code is pretty straightforward; itsets a cell on the map:
func set_cell(coord, y=0):
var hexBody = StaticBody.new()
var hexCollisionShape = CollisionShape.new()
var hexMesh = MeshInstance.new()
hexCollisionShape.shape = hexCollisionResource.instance() # Preloaded earlier in the file
hexMesh.set_mesh(hexMeshResource) # Preloaded earlier in the file
hexMesh.set_translation(Vector3(coord.x, y, coord.z))
# Put it all together...
hexBody.owner = hexMesh
hexCollisionShape.owner = hexMesh
# Connect to mouse signal
hexBody.input_capture_on_drag = true
hexBody.input_ray_pickable = true
hexBody.connect('input_event', self, '_highlight')
print('This tile has been clicked')
... yet nothing is printed out upon clicking around in the screen (after many tiles have been generated). I believe all of my settings are correct (I've checked my Project settings, and even though
input_ray_pickable is true by default, I set it to true just to make sure).
Am I doing something incorrectly?