You may remember that in past articles, I have recommended amplifying the movement of RealSense-powered objects in Unity by creating a chain of childed objects, each with a single TrackingAction script with an identical configuration. By doing this, Unity builds on the movement effort generated by the TrackingAction in the object above it in the hierarchy to generate a 'gearing ratio' effect, where the more TrackingAction' gears' you have in an object chain, the greater the movement of the overall object.
Whilst this method is extremely effective, it does come at a cost. You may find that the computer's memory resources are being drained faster by the multiple simultaneously active copies of the TrackingAction, for example. This means that you have rapid speed in the short term but the entire application begins t slow down after time.
I have found a much better approach to speed amplification though, and it is the C# scripting language.
By starting with converting very simple scripts with one or two lines, I gained confidence and experience in C# quickly. And after a week, I had converted most of my project's code to C#. C# also allowed me to greatly optimize the project's scripting by making direct activation and deactivation calls to other scripts ("hitting the metal") instead of needing the large amounts of middle-man scripts that drained the project's processing resources. And the change in the project's speed was remarkable.
I set about analyzing my avatar and finding where I could remove additional TrackingActions without negatively impacting the motion of the objects they were within (i.e having them go from being too fast to being too slow). At the end of this process, I was able to remove ten now-unneeded TrackingActions from the avatar.
Th major benefit of doing so was that although I had reduced the number of TrackingActions, in doing so I had eliminated the lag generated by those multiple scripts. This meant that whilst in theory the object speed should have been significantly reduced, in practice the reduction was barely noticable because the overall processing speed of the RealSense camera inputs had sped up in response to the elimination of those ten TrackingActions.
Another benefit was that the reduction in TrackingActions made possible by writing non-RealSense scripts in faster C also eliminated their drain on project resources. This made the application not only more stable in the immediate term but also made it more stable for longer running periods.
Using C# makes your project run faster overall.
This means that you can afford to use less TrackingActions.
Using less Trackingactions makes a project faster.
This is the Virtuous Circle referred to in the article title!
A good place to start learning the structures of C# may be the article below, where I look at a C# script and break it down section by section to explain it.
Best of luck! If you have any questions, please feel free to ask them in the comments!