Run the special when the special bar is full

I did it like this:

Power:
if Input.is_action_just_released(“atirar”):
Global.executar_especial.emit()
special bar:

Global.executar_especial.connect(executar_especial)

func executar_especial():
var poder_fogo:= poder_fogo_cena.instantiate()
if value == 13 or value > 13:
poder_fogo.Eespecial(true)
reset_especial()

but it gives null, I don’t know how I’m going to execute special without being like this

but it gives null, I don’t know how I’m going to execute special without being like this

What do you mean it “gives null”? Do you have any error in your console, or is nothing happening without any visible error or warning?

Also, when you share code, please format it using this markdown:
```
if Input.is_action_just_released(“atirar”):
Global.executar_especial.emit()
```

Which give you this, making the post much more readable and easy for us to help :slight_smile:

if Input.is_action_just_released(“atirar”):
    Global.executar_especial.emit()

(Oh, and just so you know, you can write value >= 13 instead of value == 13 or value > 13)

Where/how is podor_fogo_cena defined?

error: Invalid assignment of property or key ‘parameters/conditions/especial’ with value of type ‘bool’ on a base object of type ‘Nil’. I tried other ways but it always gives some error

That means you are trying to read a boolean variable on an object that is not assigned (meaning Godot doesn’t know where to get this boolean from, hence the error).

Check the line giving the error and try to see why an object may not be assigned properly. If you struggle with that, please attach some more code so that we can help a bit more!

The poder_fogo_cena is the power that the player takes, he is not in the scene, when the player collides with the power, he gains the powers that this power gives, such as fire etc

func Eespecial(active: bool):
	animation_tree["parameters/conditions/especial"] = active
	animation_tree["parameters/conditions/idle"] = not active
	animation_tree["parameters/conditions/andando"] = not active

Seems like the value returned by animation_tree["parameters/conditions/especial"] is null. Make sure the parameters/conditions/especial has absolutely no error compared to the animation tree, even a missing capital letter would result into the key not being returned properly.

I checked and everything is fine, there is no writing error