Inspect: Difference between revisions

From Fancade Wiki
mNo edit summary
m (Name files, and improve wording and format)
Line 10: Line 10:
Displays the value given to the input, allowing you to see the value in a variable.
Displays the value given to the input, allowing you to see the value in a variable.


== Importance ==


== Importance ==
This block is essential for debugging your games, as it allows you to know what value your variables have at all times.
This block is essential for debugging your games, as it allows you to know what value your variables have at all times.
So you can see if a position is correct, or if a loop it's reaching the desired number.
So you can see if a position is correct, or if a loop it's reaching the desired number.
Line 17: Line 17:
If you connect its only input to a variable or value block, the data will be printed on its top.
If you connect its only input to a variable or value block, the data will be printed on its top.


[[File:?]]
{{Image|Inspect debug.png}}


== Types of inspect ==
== Types of inspect ==
Line 23: Line 23:
There are 5 different inspect blocks, each one for a different type of value.
There are 5 different inspect blocks, each one for a different type of value.


[[File:?]]
{{Image|Inspect types.png}}


From left to right and top to bottom, we have:
From left to right and top to bottom, we have:


* '''Number''': either a floating-point value, truncating the decimal when necessary, or a nan or inf
* '''[[Number]]''': either a floating-point value, truncating the decimal when necessary, or a nan or inf
* '''Object''': either '''none''', or the ID of the object
* '''Object''': either '''none''', or the ID of the object
* '''Vector''': three numbers into one!
* '''[[Vector]]''': three numbers into one!
* '''Truth''': either '''true''' or '''false'''
* '''[[Truth]]''': either '''true''' or '''false'''
* '''Rotation''': a quaternion
* '''[[Rotation]]''': a quaternion


One small consideration is that the number displayed on the object inspect is not actually useful, but there is an use for the object inspect, which we will talk about bellow in the next section.
One small consideration is that the number displayed on the object inspect is not actually useful, but there is an use for the object inspect, which we will talk about bellow in the next section.
Line 37: Line 37:
And you might also notice that the rotation inspect shows a completely different value from what it's being given to it, this is because the same rotation can be expressed with different angles, so don't worry too much about this one.
And you might also notice that the rotation inspect shows a completely different value from what it's being given to it, this is because the same rotation can be expressed with different angles, so don't worry too much about this one.


It's also necessary to know that the display on this block it's only visible when the block it's on the ground, so it's impossible to see the value when you are using it inside a script block.
It's also necessary to know that the display on this block is only visible when the block is on the ground, so it's impossible to see the value when you are using it inside a script block.


And that's when: '''Advanced mode''', comes in.
And that's when: '''Advanced mode''', comes in.
Line 43: Line 43:
== Advanced mode ==
== Advanced mode ==


[[File:?]]
{{Image|Inspect advanced mode.png}}


In the image above you can see a small blue square at the bottom right, this is what advanced mode does.
In the image above you can see a small blue square at the bottom right, this is what advanced mode does.
Line 50: Line 50:
To use it all you need to do is select any inspect block in the game, once selected you will see a new button appear on the bottom right of the hotbar which says "<u>Advanced</u>", click this button and a checkmark will appear, this means advanced mode is now enabled.
To use it all you need to do is select any inspect block in the game, once selected you will see a new button appear on the bottom right of the hotbar which says "<u>Advanced</u>", click this button and a checkmark will appear, this means advanced mode is now enabled.


[[File:?]]
{{Image|Inspect advanced mode option.png}}


Now about that useless object inspect, it turns out it's actually not that useless, and that's thanks to the advanced inspect, when you activate it the object inspect will show a line going from the inspect button to the object being inspected.
Thanks to advanced inspect, the object inspect will now show a line going from the inspect button to the object being inspected, instead of displaying only an ID.


[[File:?]]
{{Image|Inspect advanced mode object.png}}


While playing, if the mode is activated, all inspected values will be displayed on the right side of your screen. If you tap on one of them, it will be printed to a "console log" on the left side. It's helpful if you want to keep track of how values change  over time.
While playing, if the mode is activated, all inspected values will be displayed on the right side of your screen. If you tap on one of them, it will be printed to a "console log" on the left side. It's helpful if you want to keep track of how values change  over time.
To stop printing the values simply tap that same button again.
To stop printing the values simply tap that same button again.


[[File:?]]
{{Image|Inspect advanced mode log.png}}


The first three lines of the log will always be occupied by percentages of object, script, and block limits consumed.
The first three lines of the log will always be occupied by percentages of object, script, and block limits consumed.


Note that activating or deactivating this option will be shared to all inspect block existing in the game.
Note that activating or deactivating this option will be shared to all inspect block existing in the game.


[[Category:Blocks]]
[[Category:Blocks]]

Revision as of 04:51, 14 June 2025

Inspect
Inspect Number.png
TypeScript block
ColliderNone
FolderValues
Ports
Inputs Before
Value
Outputs After

Displays the value given to the input, allowing you to see the value in a variable.

Importance

This block is essential for debugging your games, as it allows you to know what value your variables have at all times. So you can see if a position is correct, or if a loop it's reaching the desired number.

If you connect its only input to a variable or value block, the data will be printed on its top.

Inspect debug.png

Types of inspect

There are 5 different inspect blocks, each one for a different type of value.

Inspect types.png

From left to right and top to bottom, we have:

  • Number: either a floating-point value, truncating the decimal when necessary, or a nan or inf
  • Object: either none, or the ID of the object
  • Vector: three numbers into one!
  • Truth: either true or false
  • Rotation: a quaternion

One small consideration is that the number displayed on the object inspect is not actually useful, but there is an use for the object inspect, which we will talk about bellow in the next section.

And you might also notice that the rotation inspect shows a completely different value from what it's being given to it, this is because the same rotation can be expressed with different angles, so don't worry too much about this one.

It's also necessary to know that the display on this block is only visible when the block is on the ground, so it's impossible to see the value when you are using it inside a script block.

And that's when: Advanced mode, comes in.

Advanced mode

Inspect advanced mode.png

In the image above you can see a small blue square at the bottom right, this is what advanced mode does. With this you can still see the value of your variables regardless of where the block is or where your camera is pointing.

To use it all you need to do is select any inspect block in the game, once selected you will see a new button appear on the bottom right of the hotbar which says "Advanced", click this button and a checkmark will appear, this means advanced mode is now enabled.

Inspect advanced mode option.png

Thanks to advanced inspect, the object inspect will now show a line going from the inspect button to the object being inspected, instead of displaying only an ID.

Inspect advanced mode object.png

While playing, if the mode is activated, all inspected values will be displayed on the right side of your screen. If you tap on one of them, it will be printed to a "console log" on the left side. It's helpful if you want to keep track of how values change over time. To stop printing the values simply tap that same button again.

Inspect advanced mode log.png

The first three lines of the log will always be occupied by percentages of object, script, and block limits consumed.

Note that activating or deactivating this option will be shared to all inspect block existing in the game.