This guide explains how to debug issues that occur with visual scripting.
Master the PrintMessageToConsole Action
The PrintMessageToConsole action is dedicated to debugging.
When this action is executed, you can output any message to the Output panel at the bottom.
Set this action in the state where the issue is occurring to check if it is being reached.
- If the message is not output:
The state has not been reached, meaning there is a problem with the transition link to this state. - If the message is output:
The state has been reached, so the problem lies with the executed action or node settings such as hit detection for attacks.
Visualize Hitboxes
By checking “Visible Collision Shapes” in the debug menu, hitboxes become visible. Use this to check for collision-related issues, such as objects not moving despite hitting or passing through collisions.
Action Useful for Identifying Causes: DisplayText
The DisplayText action allows you to display variables. If you set the duration to unlimited, the text will remain displayed even if the state changes, making it useful for debugging.
For example, if an attack should be hitting but no damage is dealt, visualize the HP variable to check.
Settings Prone to Errors: CollisionLayer and CollisionMask
If an attack should be hitting but the detection isn’t working and links aren’t triggering, check the CollisionLayer and CollisionMask settings.
Contact with Wall Collisions: Detects contact between two Collision2D objects. Verify that your object’s CollisionMask matches the CollisionLayer of the object it is contacting.
Contact with Attack Hitboxes: Detects contact between your HitCollision and the AttackCollision of the contacting object. Verify that the mask of your HitArea2D matches the layer of the target’s AttackArea2D.
Contact with Hitboxes: Detects contact between your AttackCollision and the HitCollision of the target object. Verify that the mask of your AttackArea2D matches the layer of the target’s HitArea2D.
For more details on CollisionShape and CollisionMask, please refer to the following:

