How to use the variables?

In the BGE the variable declaration is in this panel :

I don’t understand how to do in armory to create them in logic node

An example:
-the player touch the wall
-the score update +1

I would add a small box around the wall the Player enters and apply this trait to the Player. You can change the nodes name to Score in the “n” panel, but the name doesn’t actually matter. No object here has to have “Rigidbody” enabled.

Thank you very much.
It’s very interesting.

But what if I have multiple walls? With different names and objects, how do you do that?
Can one make “prefabs” like a Unity?

You can use the Merge node but maybe there is a more easy way , you can copy Logic nodes and duplicated more easy like Logic bricks, as everyone knows select nodes with shift pressed and press shift+D to copy or press A to select all and copy with shift+D.

If you have a lot of objects, i would parent them all to an empty and then use get contacts" -> “Array Pop”-> “get parent” and Connect that Output to a Gate Note run by “on Update” and the empty you parented the Walls to.
You would need to enable rigidbody for the Walls and Player, but it should work. Gonna send a Screenshot in a couple minutes.

Turns out using simply the gate note adds 1 every frame the player has contact with the wall, so you need to add this extra frame to check to only allow +1 if he had been in the air. You probably need to add some nodes to force the Player to stay away from the wall for some time, not just 1 frame as it is now.

1 Like

Hooo ! Thank you. I will read.