RTS building placing

Godot Version

Godot Engine v4.5.stable.official

Question

I’m still stuck on my “building placer” for my RTS project.

Basically, have multiple button nodes child to the right Parent “Grid container”, which seem to work. It react when I click on them via Mouse click and Shortcut input. They seem only active if specific conditions are meet (Which is what I want).

I’m trying to have each button, call a specific entity and upon left click, set the entity in the game world.

I understand about 80% of how to make to whole thing work, but not tie them together so it actually functions.

I was planning on using part of the current “Get_action_pos” func to have the entity follow the mouse pos.

For visual aid, ignore the organisation. Make it work, then make it good, then make it pretty.

Within the Build_option_HUD, I’m tempted to simply add the function there to occurs when the button is pressed, but I’m 90% sure it will not do anything.

func _on_t_1_a_button_pressed() -> void:
	#insert gdscript to get entity
	pass # Replace with function body.

#Function to place the entity in the world
	#insert gdscript