LogoLogo
GeneralAccountsPlayersOwnersCreatorsThe Sandbox Website
Creators
Creators
  • πŸŽ†Welcome to the Creator Portal
  • 🟦Learn Creator Basics
    • 🟦Scale & LAND Use
    • 🟦Assets & Equipment
    • 🟦Avatars & Character
    • 🟦Look & Feel
    • 🟦Logic & Gameplay
    • ❓FAQs: Gameplay
    • ❓FAQs: Assets
    • πŸ§™β€β™‚οΈBegin Game Maker (Video Series)
  • The Sandbox Creators Forum
  • The Sandbox DAO
  • πŸͺ™Monetisation
  • Game Maker
    • ✨Create Experiences
    • πŸ”°Beginners
      • Play/Test
      • Build with Blocks
      • Place Assets
      • Set Object Actions
      • Trigger Logic
      • Craft Quests
      • Set Up Mechanics
      • Build Multiplayer Games
    • Game Maker 0.11 Update
    • 0.11 Upgrade Guide
    • πŸ“–Docs
      • Navigate Game Maker Home
      • Manage Experiences
      • Controls & Shortcuts
      • Build Menus
        • Top Bar
          • Gameplay
        • Side Bar
          • Hierarchy
          • Presets
        • Library & Quick Access Bar
        • Grid System & Snap Tool
        • Properties Panel
      • Using Blocks
      • Using Assets & Objects
        • Behaviour & Component Parameters
        • Tags
        • Messages
      • Behaviours
        • NPC - AI Pawns
          • πŸ”΅Citizen
          • πŸ”΅Farmer
          • πŸ”΅Healer
          • πŸ”΅Melee Enemy
          • πŸ”΅Predator
          • πŸ”΅Prey
          • πŸ”΅Soldier
          • πŸ”΄Friendly NPC
        • Movement
          • 🟑Door
          • 🟑Bird
          • πŸ”΄Basic Platform
          • πŸ”΄Advanced Platform
          • πŸ”΄Projectile
          • πŸ”΄Rotate
        • Basic Logic
          • πŸ”΅Message Broadcaster
          • 🟒Combination Code
          • 🟒Asker
          • 🟒Timed Events
          • 🟑Crowd Event
          • πŸ”΄Spawn Point & Avatar's Feature
        • Modifiers
          • πŸ”΅Actor Property Switcher
          • πŸ”΅Multi
          • πŸ”΅Void
          • 🟒Asset Spawner
          • 🟒Replace Asset
        • Visual
          • 🟒Post Process Effects
          • 🟑Weather Switcher
          • 🟑Animated Decoration
      • Components
        • Actions
          • 🟒Climbable
          • 🟒Avatar Teleport
          • 🟒Collectable
          • 🟒Drop
          • 🟒Slide
          • 🟒Speaker
          • πŸ”΄Pickable
        • Triggers
          • 🟒Plant
          • 🟒Switch
          • 🟒Button
          • 🟒Trigger Volume
        • Status
          • 🟒Toggle
          • 🟒Power Up
          • πŸ”΄Avatar Checkpoint
          • πŸ”΄Health
        • Gameplay
          • πŸ”΅Defeat
          • πŸ”΅Victory
          • πŸ”΄Raycast
        • NFT
          • 🟒NFT Sensor
          • 🟒NFT Image Display
          • 🟒Image Display
          • πŸ”΄NFT Details Display
        • Display
          • 🟒Indicator
          • 🟒Rarity VFX
          • 🟑Visual FX
          • 🟑Light
        • Audio
          • 🟑Play Sound
      • Objectives
      • Game Rules
        • Math
        • Time
        • Comparisons
        • Replace Variable Values
        • Game Screen
        • Triggers
        • Events
      • Build Singleplayer & Multiplayer Logic
      • Quality Guidelines
        • Optimisation
        • Testing
        • Playability
      • Templates
    • πŸ“‘Creative Guides
      • πŸ“—Game Rules Guide
        • Point Race
        • Collect Points
        • Time Trial
        • Combo
        • Hunger
        • Poison
        • Shop
      • βš™οΈLogic Guide
        • Abilities
        • Equipment Based Logic - On Equip / NFT Sensor
        • Doors & Chests
        • Collectibles
        • Text, Quests & Icons
        • Platforms
        • Victory & Defeat
        • Miscellaneous
        • NFT Inspect
        • Fighting
      • 🏞️Experience Guide
        • Tower Defense
        • Horror / Backrooms
        • Solo Platforming
        • Social Platforming
        • Resource Management
        • Cooking Simulator
        • Survival
        • Action / Adventure
        • Night Clubs & Concerts
        • Virtual Home & Architecture
        • NFT Gallery / In-Game Shop
        • Puzzle Games
        • Social Hubs
        • Simulation
      • 🎲Experience Design Techniques
        • Narrative Design
          • Worldbuilding
          • Storyboard
          • Dialogue
        • Art Design
          • Experience Art Concept
          • Asset Curation
          • Blockout Aesthetics
          • Detailing / Dressing
        • 3D Spatial Layout
          • Rough Base Map
          • Greyboxing / Blockout
        • Game Design
          • Ramp of Difficulty
          • Risk & Reward
          • Game Loops & Decisions
    • 🎬Game Production Guide
      • πŸŸ₯Concept
      • 🟧Blockout
      • 🟨Logic
      • 🟩Art
      • 🟦Quality Assurance
      • πŸŸͺPolish
      • ⬜Marketing
    • 🧰Publish Experiences
      • Experience Manager
        • Experience Analytics
        • 🧰Experience Page
          • Content Guide
          • Marketing
          • Create an Experience Trailer
          • Player Engagement
        • Map Location
        • Asset Review
        • Access Restrictions
      • Collaborating With Third Parties
      • ❓FAQs: Experience Publishing
    • πŸ•˜Version Notes & Changelogs
      • Game Maker 0.11
        • ❗0.11 Upgrade Guide
      • Game Maker 0.10
      • Game Maker 0.9
      • Game Maker 0.8
      • Game Maker 0.7
    • ❓FAQs: Game Maker
  • VoxEdit
    • ✨Create Assets
    • πŸ”°Beginners
    • πŸ“–Docs
      • Navigate VoxEdit Home
      • Controls & Shortcuts
      • Panels & Custom Layouts
      • Block
      • Modeler
        • Use Modes & Tools Together
        • Set the Pivot Point
        • Create Frame Assets
      • Animator
        • Build a Rig
        • Create an Animated Asset
        • Use Inverse Kinematics
      • Templates
      • Quality Guidelines
        • Asset Types & Collisions
        • Asset Scale
        • Node Efficiency
        • Pivot Point & Alignment
        • Animation
        • Visual Quality
        • Asset Name & Description
        • Manage Files & Folders
    • πŸ“‘Creative Guides
      • 🧍Asset Guide
        • Structures & Landmarks
          • Basic Building: No Entry
          • Animated Building: No Entry
          • Unanimated Building: Player Entry
          • Landmark
          • Building Facade
          • Structure Component Parts
          • Modular Architecture
        • Humanoids & Animals
        • Vehicles
        • Equipment
        • Art: Statues, Paintings
          • Animated Art Screens
          • Statues
          • Kinetic Art Sculptures
          • Paintings
          • Performance Art
        • Furniture
        • Platforms
        • Doors, Gates, and Windows
          • Multi Design Door Asset
        • Chests & Other Animated Interactions
        • Plants, Trees
        • Objects, Machines
        • Signs & Text
        • Obstacles
        • Create Frame Assets
      • 🎨Art Techniques
        • Asset References
        • 3D Design
          • 🧹Need to Simplify?
          • βœ‚οΈTrim All Volumes
          • 🟒Optimize with Texture
          • 🟒Curved Edges: Blocky Style
          • 🟑Break Down Objects
          • 🟑Create Smooth Angled Lines
          • 🟑Circular Shapes: Cross Technique
        • Colour, Texture & Depth
          • πŸͺ…Colour Choice & Strategy
          • 🧱Textures & Materials
    • 🧰Upload Assets to Workspaces
    • 🌟Mint & List Assets to Sell
    • πŸ•˜Changelogs
    • πŸ”“Open Source Assets
    • ❓FAQs: VoxEdit
  • Creators Program
    • πŸ—οΈBuilders' Challenge
      • Rules & Eligibility
      • Earnings & Rewards
      • How to Succeed in the Builders' Challenge
      • ❓FAQs: Builders' Challenge
    • ℹ️Creator Contests
    • πŸ†Game Jams
      • Rules & Guidelines
      • Judges & Voting
      • Explore Past Winners
      • ❓FAQs: Game Jams
    • πŸ†VoxEdit Contests
      • Rules & Guidelines
      • Judges & Voting
      • Explore Past Winners
      • ❓FAQs: Voxel Art Contests
  • General
    • πŸ“šThe Sandbox Documentation
    • πŸ”„Play, Create & Earn
    • πŸ—ΊοΈMap
    • πŸ›’Marketplace
    • πŸ—£οΈDiscord Community
    • πŸ”—Social Networks, News & Blogs
    • The Sandbox Linktree
    • ❓Help & Contact
Powered by GitBook
LogoLogo

INFO

  • Discord
  • Social, News & Blogs
  • Service Status

PLAY

  • Events
  • Map
  • Avatar

CREATE

  • VoxEdit
  • Game Maker
  • Contests

OWN

  • SAND
  • LAND
  • Staking

Copyright Β©The Sandbox. All Rights Reserved.

On this page
  • Use Cases
  • Math
  • Add/Subtract Number Continuously

Was this helpful?

  1. Game Maker
  2. Docs
  3. Game Rules

Math

PreviousGame RulesNextTime

Last updated 3 months ago

Was this helpful?

Use Cases

  • Currency systems

  • Resource management

  • Health and life counter systems

  • Damage systems

  • Upgrade systems

  • Leveling up and scaling

Set Broadcast Type to All or Rules to send messages from objects to the Rules System.

Reduce a numerical variable with a negative value.

Math

Perform basic math operations with time and number variables using one versatile rule.

A timer must be paused in order for the Math rule to work correctly with a time variable.

The Math rule may use values and variables for integers, decimals, and time.

Required Message

Select the incoming message to trigger the rule.

Operand 1

Select one of the following:

  • Variable will allow you to select an existing numerical variable or create a new one.

  • Fixed value will allow you to enter a constant numerical value.

  • Message Argument will allow you to use an argument sent within the Required Message that triggered the rule. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.

Operator

Select the mathematical operator for the calculation (e.g., add, multiply, etc).

Operand 2

Select variable, fixed value, or message argument (see Operand 1).

Result

Select a number or decimal variable to staore the result of the calculation.

Message to Send

Select the message that will be sent after the calculation.

Add/Subtract Number Continuously

Add or subtract from a numerical variable repeatedly for a set time period. Optional: Set a maximum and minimum value for the variable used.

A timer must be paused in order for the Add/Subtract Number Continuously rule to work correctly with a time variable.

Add/Subtract number continuously

Required message

The message to activate this tree. Every time this message is broadcast the tree will be triggered.

Time variable

This defines the time variable, that is used to measure time in this tree.

Duration

There are three modes to define the time between each increase/decrease:

  • Variable will allow you to define an existing variable to modify the timer. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.

  • Fix value will allow you to set up a constant value. An input field will appear to enter the number value.

  • Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.

Number variable

This defines the number variable that is modified by this rule. This could be a players score or stat like hunger.

Value change

There are three modes to define how much time will be added to the number:

  • Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.

  • Fix value will allow you to set up a constant value. An input field will appear to enter the number value.

  • Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.

Minimum Value

There are three modes to define the minimal value. The number variable won’t be lower than this value.

  • Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.

  • Fix value will allow you to set up a constant value. An input field will appear to enter the number value.

  • Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.

Maximum Value

There are three modes to define the maximal value. The number variable won’t be higher than this value.

  • Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.

  • Fix value will allow you to set up a constant value. An input field will appear to enter the number value.

  • Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.

Message to stop the rule

This message is stop the rule from running.

πŸ“–
Powerful Math rule works with integer, decimal, and time variables