Thxs, but the issue is that if i can get cursor_state
var from the Use button, i cannot get it once it has been modified to "selecting" by button_pressed
func. I just get the cursor_state
set to "normal" from the script. See my code at the begining of the thread.
This is the code of my collisionshape:
func _on_Area2D_input_event(_viewport, event, _shape_idx):
var roll = roll_a_dice(1, 100)
var node = get_node("/root/Node2D/Control/Use")
print(roll)
print(node.name);
print(GlobalP.charm)
print(node.cursor_state)
if event is InputEventMouseButton and event.pressed and event.button_index == 1:
if roll < GlobalP.charm and node.cursor_state == "selecting":
print("okokooooooooooooooooook")
That cursor_state
should be "selecting" cause i click the collisionshape having pressed the button and changed my cursor just before. But this script doesn't recognize it, it just get the cursor_state
"normal"...