anthony.wells Posted December 5, 2020 Share Posted December 5, 2020 Hi, I have created a .track file within the editor, but I can not figure out how to play this back within the game, either via code or in the editor? It's a simple camera animations, it works fine from within the tracker tool, but as said I can't see how to play it within C# or auto-play when the game plays. Link to comment
fox Posted December 7, 2020 Share Posted December 7, 2020 Hi Anthony! The Tracker tool currently has got only UnigineScript API. But it is possible to make a C# wrapper for it. Suppose you have some .track files prepared, and you want to play them via C#... This can be done as follows: Download the tracker_wrapper.h file attached. In the Asset Browser create a new USC script, let's call it script.usc In this file add the following line after all includes: #include <tracker_wrapper.h> Assign the script.usc file to your world by simply dragging it to the Script field in the Parameters window as shown below (when the .world-asset is selected in the Asset Browser) Now we need a C#-wrapper - simply download the attached TrackerWrapper.cs file and copy it to your project's source folder. Add the TrackerWrapper.cs file to your project. E.g., you can manually modify the .csproj file by adding the following line next to where all your AppEditorLogic, AppSystemLogic, and AppWorldLogic are included: <Compile Include="source\TrackerWrapper.cs"/> Now we can simply play our tracks via C#. I've made a simple component for you to illustrate the process (please find the TrackPlayer.cs file attached). Assign this component to any node in the world (don't forget that the node should be enabled for the component's logic to be executed). Then drag your track(s) to the fields of the Tracks array (you can add as many as you wish). Then save your world, click Play, and enjoy your tracks playing in the game. Hope this helps! tracker_wrapper.h TrackerWrapper.cs TrackPlayer.cs 2 1 Link to comment
Recommended Posts