Modulo: Difference between revisions

From Fancade Wiki
(Unclutter, reformat and add template Block)
(Added an example image)
 
Line 18: Line 18:
With the accompany of the [[Current Frame]] block in input A, you can specify an event that takes places every X frames. For example, because 60 frames can be converted into 1 second, input B could be 60, and when this script is run, it is going to execute it every 60th frame (a second), where the output of the modulo equals to 0.
With the accompany of the [[Current Frame]] block in input A, you can specify an event that takes places every X frames. For example, because 60 frames can be converted into 1 second, input B could be 60, and when this script is run, it is going to execute it every 60th frame (a second), where the output of the modulo equals to 0.


[[File:Modulo_do_every_X_frames.png]]
{{Image|Modulo example1.png|Play a sound every 60 frames}}


== Related ==
== Related ==

Latest revision as of 09:11, 21 May 2024

Modulo
Modulo.png
TypeScript block
ColliderNone
FolderMath
Ports
Inputs a
b
Outputs mod(a,b)

Outputs the remainder of a division calculation.

Notes

  • If the calculation doesn't have a remainder, the modulo will be 0.

Examples

With the accompany of the Current Frame block in input A, you can specify an event that takes places every X frames. For example, because 60 frames can be converted into 1 second, input B could be 60, and when this script is run, it is going to execute it every 60th frame (a second), where the output of the modulo equals to 0.

Play a sound every 60 frames

Related