An action I whipped up the other day for use in a camera shake algorithm... I needed a random value to animate with and I found the perlin noise function.
*NOTE* At this time, the non-declared axis is a randomly chosen value. If the general consensus is that this should be given the option (such as a "use random" bool and a "choose value" float input) to choose where on the other axis this scans across, I can add that in (I think.)
How to use this action:
- Choose which axis to scan across. This works in either the X or Y. This option is only in there so as to allow some additional variation on the output in case you use multiples of this action.
- Set the output variable (Float.) *NOTE: At this time I haven't figured out how to make it only use a variable... If you know, please let me know as well as I think having it open to only producing a value and not depositing it into a variable is pretty counter-productive. If you know the action(s) I should reference, please let me know.*
- Set the multiplier. This is for if you want to either amplify or diminish the value within the action so you can save yourself having to multiply it manually with another action. Just felt right to add it in.
- Set the noise speed. This sets how fast the sampling will scan across the chosen axis.
- Set whether this is every frame or only once. (So, if you wanted a random value only once, you can use this... But realistically, the "random float" is probably better... But hey, it's there in case you wanted to use this either only once or every frame.)
This only produces a positive value and if you leave the multiplier as 1 then it will only produce a value between 0 and 1.
If you have any tips, suggestions or critiques of this, feel free to let me know. Anything I can do to improve this action (and by extension my own knowledge/skills at coding) is more than appreciated.