@tool script not updating in the editor

Godot Version

4.4

Question

I have a @tool script which creates an arbitrary mesh

@tool
extends MeshInstance3D

func _process(delta):
if !Engine.is_editor_hint():
var terrain =
terrain.resize(ArrayMesh.ARRAY_MAX)

	var verts = PackedVector3Array()
	var indices = PackedInt32Array()

	verts.append(Vector3(0,0,0))
	verts.append(Vector3(1,0,0))
	verts.append(Vector3(1,0,1))

	indices.append(0)
	indices.append(1)
	indices.append(2)

	terrain[Mesh.ARRAY_VERTEX] = verts
	terrain[Mesh.ARRAY_INDEX] = indices
	mesh = ArrayMesh.new()
	mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES,terrain)

but strangely the mesh in the editor is an older version of the mesh (upright)
and when I run the game the mesh shows up properly

(in game)


(editor)

I’ve tried restarting the editor multiple times

figured it out
it was the
!Engine.is_editor_hint()
it was doing the opposite of what i wanted it to do