playMaker

Author Topic: Log10 and Logarithm actions  (Read 341 times)

nuFF3

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 74
  • Are we even real?
    • View Profile
    • One Month Studio
Log10 and Logarithm actions
« on: January 16, 2021, 02:33:30 PM »
I couldn't find any logarithm actions anywhere, so I decided to make them myself.
I really can't believe no one has made something like this before, since it's pretty vital for setting AudioMixer volumes more correctly, but it also has it's other uses too.
For setting volume one can use the "Convert Float To Decibels" but that's a very specific action for one thing. These actions at least have the possibility of being used for other stuff too.

I've made two actions and edited another from the Ecosystem.
The two that I made are the Float Log10 and Float Logarithm actions.
I edited the Float Operator Advanced to include logarithm operations along with what it already had.

Float Log10 takes one float variable, operates Mathf.Log10, and stores the result in a separate variable.
Float Logarithm does pretty much the same, but it takes both a variable for the Mathf.Log and a variable for base for the logarithm. It too stores the result in a separate variable.

Float Operator Advanced 2 is pretty much unaltered apart from the code that was needed for the logarithm to work.

Hope it helps.
« Last Edit: January 21, 2021, 02:50:51 PM by nuFF3 »