Search Unity

Object Motion Tracker - Engine Trails, Time Travel, Game Mechanics...... and more!

Discussion in 'Assets and Asset Store' started by code-blep, Apr 19, 2014.

  1. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi,

    A new version of my component has been released on the Asset Store called Object Motion Tracker, I am using in my own game, and thought it was about time I mentioned it here in the forums now that a number of people have used it....

    Forum-big.png

    About Object Motion Tracker

    Object Motion Tracker is a component written in C# for the Unity Game Engine that will enable you to generate waypoint data of where an object has been, and also it’s rotation, and time since scene started when the waypoints are generated.

    You are then able to access the data and use it in all sorts of ways such as engine trail FX, trailing magic FX, time travel, game mechanics, you get the idea!



    Current Features are:

    • Loads of options to tweak and control the waypoint data just how you want it:
      • Adjustable Per Frame waypoint plotting
      • Time based waypoint plotting
      • Distance based waypoint plotting
      • Time and Distance combination waypoint plotting
      • Multiple methods for waypoint removal
      • Enable/Disable the storing of rotation and time based data
    • Multiple Waypoint Groups – The ability the stop tracking and start storing waypoint data to a new group
    • Offset Waypoint Data:
    • Offset by a fixed amount
    • Offset using Min and Max positions modified by a percentage value
    • Track a child object of the object that is being tracked
    • Waypoint Merging – Gracefully merge and remove old waypoints
    • Waypoint Limiter – Set max limit of waypoints
    • Extensive debugging options
    • Tons of example scripts
    • Full documentation

    Component Options
    • Loads of options to tweak and control the data just how you want it:
      • Multiple waypoint plotting modes
      • Time based waypoint plotting
      • Distance based waypoint plotting
      • Combined time and distance waypoint plotting
      • Multiple waypoint removal methods
      • Multiple waypoint merging methods
      • Enable/Disable rotation and time data logging
    • Multiple Waypoint Groups – The ability the stop tracking and start storing waypoint data to a new group
    • Control what types of data are stored and the structure of that data
    • Offset Waypoint Data:
      • Offset by a fixed amount
      • Offset using Min and Max positions modified by a percentage value
      • Track a child object of the object that is being tracked
    • Waypoint Merging – Gracefully merge and remove old waypoints
    • Waypoint Limiter – Set max limit of waypoints
    • Extensive debugging options
    • Tons of example scripts
    • Full documentation


    Full Featured Interface

    Fully customised colour coded interface, complete with waypoint overview diagram, tooltips, debug panel, notes section and easy access to the stored data. Full visualisation of the waypoints being generated via the Scene window.
    Waypoint Data Access Examples

    Comes complete with scripts showing how to access the waypoint data, and how to configure Object Motion Tracker using scripts.


    Ready To Use Examples

    Want to use Unity’s built in components with Object Motion Tracker? Or see some examples of what it can be used for? Included examples to get you up and running quickly are:

    • Time Travel Script: Move back in time in various ways
    • Raycast: Detect when an object passes through the path you have travelled!
    • Particles: Generate particles along the path you have travelled!
    • Follow: Make an object follow the path you have travelled!
    • Line Renderer: Create engine trails or magic FX using Unity’s built in Line Renderer!
    • Vectrosity: Create engine trails or magic FX using Vectrosity!

    $Object Motion Tracker - Screenshot-2.jpg

    $buy-now.png
     

    Attached Files:

    Last edited: Sep 10, 2014
  2. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    1.2: Initial Public Release after internal testing and general use

    1.3: C# and JS Version of all scripts and the component

    1.4: Now includes adjustable per frame based waypoint plotting and a time travel script

    1.5: Scale data is now being be stored. Updates and new functions to the time travel script. Dropping JavaScript Versions. Bug Squashing.

    1.6: Updated the time travel example script, so that it checks there is data to work with before doing anything.

    Significant Update
    2.0: New Features:
    • Save your waypoint Data:
      • Saved as a comma delimited file allowing to analyse the data in 3rd party tools such as spreadsheets or use a 3rd party tool to generate/modify data!
      • Reverse waypoint group order so that data will be in time order. Making analysis even easier!
      • Full control over file names and location
      • Save can be done in the editor (without starting the scene)
      • Save can be triggered via your own scripts
      • File overwrite protection
    • Load your waypoint Data:
      • Replace existing data
      • Add to start of existing data
      • Add to end of existing data
      • Mark all waypoint groups as non-active on load
      • Reverse waypoint group order, useful if waypoint groups were saved in reverse order.
      • Load can be done in the editor (without starting the scene)
      • Load can be triggered via your own scripts
    • Save Object Motion Tracker Settings:
      • Saved within your waypoint data, so that you can use the same settings that were used to generate the waypoints!
      • Save only the OMT settings, just use it as a way of saving different set-ups!

    • Specify your own prefix ID to the waypoints - Useful if you have multiple objects generating data, or using a 3rd Party tool to analyse the save data.

    • Auto assign is now optional. OMT will automatically assign the game object it is attached to, as the object to track.

    • General optimizing to reduce garbage collection, and generally make things more efficient.
    2.1: More updates to the time travel example script! The scrub bar now provides more feedback, and better handling of situations where the active waypoint group is being accessed.

    OMT now provides easy access to the index number of the current (or last if not longer tracking) active waypoint group.
     
    Last edited: Jan 28, 2015
  3. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    Purchased it yesterday and all I can say is that its an amazing and well organized plugin. Anyone interested in it please watch the video, the author has done an excellent job at making it. This is the only asset where I have seen the video only once and I could trial the plugin aspects I needed without going back to the video, great job. I too am using Vectrosity and I hope future updates integrate additional aspects of Vectrosity in OMT.

    I had a quick question. The waypoint trails in the editor window are only visible when OMT GO is selected, is this by design? Would it be possible to see the trail if the focus is not on the OMT GO?
     
  4. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Thanks iamsam! I was worried the video might have been overkill, and I actually plan to produce a shorter showcase video to show the end results. If you have time I would very much appreciate it if you did a review on the asset store?

    EDIT: Correction to my previous answer (Sorry long day!)

    Are you using the C# version? I think I see the problem.....
    Open OMT_CS and go to line 816. You should see:

    Code (csharp):
    1. void OnDrawGizmosSelected ()
    change it to:

    Code (csharp):
    1. void OnDrawGizmos ()
    Hopefully that will sort it. I make the change in the next version.

    Hope it helps iamsam!
     
    Last edited: Apr 23, 2014
  5. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    Thanks for the quick reply, your suggestion worked perfectly.

    I am excited to see what new features are coming in v1.4
     
  6. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    No problem iamsam, glad it worked! As for V1.4 there will be a few new features, and some more example scripts of new and interesting ways to use OMT, as well as the above fix. I will post here when it is out!
     
  7. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    " I hope future updates integrate additional aspects of Vectrosity in OMT."

    Do you have any specific Vectrosity requests iamsam?
     
  8. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi,

    Just a quick message to say that if you are about to buy Object Motion Tracker, you might want to wait :)

    It's going on sale with a 25% discount soon, and has a new PER FRAME TRACKING feature.

    I'm just waiting for it to be approved.

    Thanks!
     
  9. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    New version and 25% discount now live!
     
  10. MrPhil

    MrPhil

    Joined:
    Sep 22, 2010
    Posts:
    40
    Hey! New owner here. I'm making a replay system for my game... think Super Meat Boy after you finish a level.

    FYI, Using the TimeTravel script to replay the movement and it's causing an exception:
    Edit: It looks like the problem is I didn't have rotation and time checked, but it still not working?
    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.Quaternion].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    OMTTimeTravel_CS.TimeTravelListBuild () (at Assets/OMT - Object Motion Tracker/OMT Example Scenes/OMT Example C# Scripts/OMTTimeTravel_CS.cs:96)
    OMTTimeTravel_CS.TimeTravelMachine () (at Assets/OMT - Object Motion Tracker/OMT Example Scenes/OMT Example C# Scripts/OMTTimeTravel_CS.cs:58)
    UnityEngine.MonoBehaviour:StartCoroutine(String)
    OMTTimeTravel_CS:Update() (at Assets/OMT - Object Motion Tracker/OMT Example Scenes/OMT Example C# Scripts/OMTTimeTravel_CS.cs:50)​
     
    Last edited: Aug 3, 2014
  11. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi MrPhil! Thanks for the purchase much appreciated!

    1: Edit: It looks like the problem is I didn't have rotation and time checked, but it still not working?
    You have found an issue where the time travel example does not check if rotation and time data is actually being stored by the OMT component. Thanks for letting me know, I am fixing that right now.

    2:Continued error: Can you provide more info about what you are doing? Are you just playing with the time travel script or have you modified it at all? Either way, while fixing point 1, I will carry out more testing to see if I can replicate it.
     
  12. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    OK, made some changes and can't break it this end. If you PM you order number and email address, I will package up and send you the latest version (V1.5) that is due for release anyway (Holiday and Ill health both got in the way). That way you don't have to wait to the asset store ;)

    V1.5 now logs the object scale, and additional functionality has been added to the time travel script to work with the new scale data! ...... as well as the bug fixes in the time travel script of course ;)
     
  13. MrPhil

    MrPhil

    Joined:
    Sep 22, 2010
    Posts:
    40
    I've only been playing around with your code, but I haven't built my own system yet. The basic problem is when I create a sphere and drag it to the target on the Time Travel and then click the Time Travel bool it doesn't move.

    Edit: Actually, I should say it does move to the first waypoint, but then no further.
     
  14. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Mr Phil and I are now in an email conversation and I will post the results of the conversation here.
     
  15. MrPhil

    MrPhil

    Joined:
    Sep 22, 2010
    Posts:
    40
    Hexagon Neuron was really helpful and not only fixed my problem but even wrote some custom code specific to my needs. Thanks Hexagon Neuron! 10 Stars, Would Buy Again!
     
  16. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Thanks MrPhil, much appreciated. I will be releasing the new modified version of the time travel script (2 new methods of time travel) with the V1.5 release (Scale data logging!). Not sure when that will be, hopefully sometime this month. Watch this space!
     
  17. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi Everyone. Just a little notice to say that V1.5 has been released! Scale data logging, bug squashing, updates to the time travel script for Super Meat Boy still replay. I have also dropped JavaScript support as all enquires and general support queries have been for the C# version.

    I'll be keeping it on sale until I release my next new component! More on that soon ;)
     
  18. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    I came across this thread and I must say this seems to be a really great asset!
    I have only one question: Is it possible to store the waypoint data permamently, so it doesn't get lost when I leave the play mode? I was thinking of a scriptable object that acts like a database, so you can store this data and attach it to other gameobjects later. This would open a lot of more possibilities to work with this asset.(Like recording the movment of objects that under control of the physics system and use this data for other editor assets.)

    Great work!
     
  19. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    Nice update, have been using this in all my projects, amazing plugin at a great price.

    - I agree, this would be an excellent addition to this plugin.

    I had a quick naive question, I am trying to visualize the trail during runtime and was wondering if it is possible for the trail only to be rendered on one camera. I tried assigning the omt object to a different layer, however the line is still being rendered on the other camera, I guess I am doing something wrong.
     
  20. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi sloopidoopi and hello again iamsam :) Sorry for the delayed reply and can't seem to get the forum to notify me of new posts.

    Storing of waypoint data is on the cards, and will be the focus of the next version, and I have some ideas to extend that aspect even further! However I am right in the middle of bringing a new component to the asset store. Most of the code is done so artwork, documentation and assorted web stuff still needs to be done. After that, I'll start work on the new version of Object Motion Tracker. If either of you are desperate for it, I will see what I can do to bump things along.

    As for your trail question iamsam, remember that OMT creates the data, any of the example scripts I include make use of that data, so the camera assigned to it will be irrelevant :) Which trail are you using? Are you using the Vectrosity or Unity Line Renderer version? Also I must confess to being a little confused by the question. You should be able to see any trails mentioned above at runtime. The only other thing I can think of is that you are referring to the debug display? If so that uses Unity's OnDrawGizmos () which is only available in the Scene window. Unfortunately there is no way round that. If that is the case, could you explain why you need that kind of option. Maybe it's something I've not thought of ;)

    Thank you both for the feedback it really is appreciated!
     
  21. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    Hey, thanks for the reply.

    I have currently implemented a quick database to store the waypoint data but having it would surely be great and save a lot of time as well as keep the code clean. What would be the approximate time frame for incorporating this feature, there is no rush I just want to know so that I can work on another portion of the project if it would be implemented in the coming weeks.

    I am using Vectrosity to render the trails and they work very well at runtime. I guess my question was more generic in that I am able to view the trails from all cameras present in the scene at runtime, however is it possible for me to hide it from certain cameras? So for example if I have an first person camera and a top down camera, would it be possible to render the trail at runtime only in the top down and not the first person camera?
     
  22. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Great news!
    The Gizmos could displayed in the Game view (also in Play mode). You can just turn on/off Gizmos with the"Gizmos" button at the top right of the Game view window :cool:
     
  23. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    @iamsam : No idea on time scale is the honest answer. If I had to guess I would say between 4 and 8 weeks. I will of course see what I can do to bring it forward ;)

    As for Vectrosity and cameras, I have never tried to assign specific cameras to Vectrosity but I did did this out of page 14 in the Vectrosity Documentation.pdf:
    "VectorLine.SetCamera();
    This normally only has to be done once, such as in an Awake function. If you allow resolution switching in
    your project, it has to be called once after every resolution change. SetCamera uses info from your normal
    camera. As mentioned, by default it uses the first camera in the scene tagged “Main Camera”. The vector
    camera will survive level changes; however, you may need to call SetCamera again after changing levels,
    unless the normal camera also survives level changes (see the note below about layers).
    You can optionally pass a specific camera instead of relying on the “Main Camera” tag
    :
    VectorLine.SetCamera (camera);"
    At that point layers might come into play. That is also covered in the same page. Sorry I can't go into more detail but hopefully it will help get you started.

    @sloopidoopi : I happened to notice your UniOSC component, that will come in useful for a future project I have in mind, especially with all those great reviews! :)
     
  24. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Glad to hear that. I also couldn't resist to buy your asset :D
    I will play around in the next days, but on my first test I had an issue to get the scene running:
    When I try to start a clean new project with the OMT example scene I get a ArgumentOutOfRangeException from OMTTimeTravel_CS.cs line:66. I have to enable the 'Tracking Active' option from the OMT_CS script to prevent this.

    Hopefully tomorrow I have some more time to check all the features from OMT.
    The first impression from the OMT_CS Editor is great. (Very well polished GUI.)
     
  25. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    I just looked and there is indeed an error on start. I'll push it to the top of the list and will push out a fix in the next few days! Thanks for the heads up sloopidoopi!
     
  26. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Fixed! I'll submit the new version asap! I should have put in a check to make sure there was waypoint data to use before trying to time travel. Let me know if you find anything else ;)
     
  27. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    The time travel script fix should be live any day now, as I submitted it on Tuesday night!

    I have also started work on saving the data, after all your requests and a particularly interesting request, where Unity and Object Motion Tracker are potentially being used for science!
     
  28. coolbird22

    coolbird22

    Joined:
    Mar 20, 2014
    Posts:
    38
    Hi there. This looks like quite a handy asset for gamedev. Would like to know if it is possible to play back the recorded path using the Time Travel script ?
     
  29. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    @coolbird22 - Yes! There is even a scrub bar example where you can scrub back and forth through the time. There is a small bug in the current version, but a new one was submitted nearly a week ago (V1.6), so it should be live any day now!
     
  30. coolbird22

    coolbird22

    Joined:
    Mar 20, 2014
    Posts:
    38
    Hi Hexagon-Neuron - That sounds great ! The Asset Store is showing the current version as 1.6, so I'm assuming it is live, as changelog does state the fix in the time travel script.
     
  31. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    So it is! I normally get an email from the Asset Store saying that it has been accepted and is live. Thanks for letting me know.
     
  32. coolbird22

    coolbird22

    Joined:
    Mar 20, 2014
    Posts:
    38
    Sure thing ! Also, if it is not much for me to ask this, is it possible for you to make a showcase video for the time travel feature of your asset, since it is missing from the video on Youtube ?
     
  33. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    I've been meaning to do some update videos, especially with the new update that's coming out soon. I would image it's going to be a number of weeks before it gets done, but I'll try and bump it up the list. Do you need help? Feel free to email me or ask here :)
     
  34. coolbird22

    coolbird22

    Joined:
    Mar 20, 2014
    Posts:
    38
    Apologies for (somewhat) hijacking your thread here. I've been trying to work on getting a time travel system to work for me. I need to be able to rewind and replay back the recorded player movements. I tried to create a list that saved all of the positions,rotations,etc and then be able to move through the list depending on the requirement, but for some reason, it isn't exactly working for me the way I wish to. I was looking into different asset in the Asset Store, called Rewind Time Manager, which does a wonderful job of rewinding, but as it rewinds, it loses all of the data, so a replay is not possible, which is why I asked you for that particular possibility in your package. I'd love to buy your package but I kinda hoped to maybe see it in motion, so as to be sure of what I'll be receiving. I might be nitpicky now, but it might be great to have interpolations that can change the speed of the rewinding, to give it a better feel. Example for that would be something like, the rewinding starts off at normal speed, but as it approaches the end(the starting theoretically) it starts to speed up. Thanks for taking the time to read this !
     
  35. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    No problem! OK I've put together a quick demo video, but it's rough as hell ;) Hopefully it will give you an idea. The scripts I include are demos to show how the data can be used. However I do try to add features and grow them into something more when possible. Such as the saving of data to a file function I am working on right now ;)

    In the video the red markers are generated by Object Motion Tracker Debug so you can see the waypoint data generated. I have pre recorded some data before recording the video.

    Temporary Video Removed
     
    Last edited: Sep 10, 2014
  36. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    V1.7 is coming along well! Now saving and loading waypoint data! Currently working on a few more features, and one of them (if it works out!) takes saving and loading that one step further! More updates soon :)
     
  37. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Looking forward to get my hands on! Keep up the great work!
     
  38. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    @sloopidoopi @iamsam @MrPhil - Would you like to Beta Test what will now be V2 of Object Motion Tracker?
    See the top of this thread for all the shiny new features! If so PM some contact details so I can share the beta with you!
     
  39. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    The new saving features look really good! (they are actually very similar to what I had implemented in my project :)), will send you a PM with the details soon.

    Also just to let you know that the Vectrosity example script might throw an error as SetColorsSmooth is no longer present and is replace by SetColors (myColors).

    Eric helped me with the camera situation and if anyone want to render the line only on selected cameras using Vectrosity, you need to use vectorLayer3D to define the layer which needs to be culled by the other cameras.
     
  40. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    @iamsam - I guess it must have been the logical way to do it ;) I'll keep an eye out for your PM, the beta package should be ready in the next few days.

    Also thanks for letting me know about the Vectrosity change. It never threw any errors but I have updated the code accordingly. Useful to know about the cameras as well. I might take a peek at that myself at some point.
     
  41. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi Everyone. V2 is now available on the Asset store. I have already had some feedback including further improvement suggestions, and I'll be looking at them over the coming weeks. Thanks!
     
    meapps likes this.
  42. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    Great just bought sry that it took so long...
     
  43. ishlilith

    ishlilith

    Joined:
    Mar 16, 2012
    Posts:
    13
    Hello, I just bought it in the sale, but I cant even get the examples to work.

    The follow waypoints example, besides not being configured out of the box does not follow the waypoints. All of the modes are useless for me except Length Last, but it does not work if the tracking is active, instead of going to the starting position and follow the trail of the object is following it's going to some random point in space.
    I suppose it is because you add the new points at 0 so it never it because it is always generating a new one.
    Unless I'm missing something very obvious having to keep track of the number of waypoints generated since the waypoint to reach was assigned sounds as much work as implementing a replay system from scratch.

    And the time scrub does not work, when enabling the scrubbing bar it sends the cube straight to the moon.
     
  44. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi ishlilith. First of all thanks for buying and letting me know it is in the 24hr sale. I didn't know!

    As for your problems and questions I am more than happy to help to get you up and running :)

    Do you have an example project you want to send? Or maybe we can chat via skype? Let me know and we'll sort it. I am based in the UK and was asleep when you posted, just woke up, had a coffee and ready to get you up and running.

    As for the example script not working out of the box, I'll take a look a right now....
     
  45. ishlilith

    ishlilith

    Joined:
    Mar 16, 2012
    Posts:
    13
    The problem I'm having is that I don't know how to make an object follow another, or go back in time, while it is still recording.
    Just imagine an object starting following 5 seconds (or frames, or a random amount of time) later than the object it follows. I just cant make that.

    Also is there some API documentation or even some helper methods?
    The only way I found to start a ghost car when a lap is completed is with this code

    Code (CSharp):
    1.   GameObject go = Instantiate(objectToSpawn) as GameObject;
    2.   Follow follow = go.AddComponent<Follow>();
    3.   follow.startFollow(omtComponent.waypointGroups[omtComponent.waypointGroups.Count-1]);
    4.   omtComponent.trackingActive = false;
    5.   omtComponent.SendMessage("TrackingStart");
    6.   omtComponent.trackingActive = true;

    Surely there must be a more intuitive way to start a new recording and get the last one?
     
  46. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi ishlilith. We'll start with
    Follow waypoints example script:
    Yes, it's not setup to work straight out of the box, as I did not like to clutter up the scene with all sorts of objects for the examples. However all you have to do is add your object to the scene. Enable the '- OMT Follow Waypoints' gameobject. Then in the 'OMTFollowWaypoints_CS' script drag an drop the object you want to follow the waypoints into the 'ObjectToFollowWaypoint' filed. Then set 'waypointFollowMode' to 'Last Waypoint' or 'First Waypoint'. Press play.

    Time scrub example script:
    I've downloaded a copy OMT myself today, and can indeed confirm that the time scrub bar does cause some funky movement! I am going to work on a fix for it this weekend, and will submit a new version to the asset store asap. They are of course just example scripts on how to access and manipulate the data, but it would be nice if they didn't send the object shooting off ;) If you want an early copy of the fix let me know and I'll sort it out. Thanks for letting me know!

    "The problem I'm having is that I don't know how to make an object follow another, or go back in time, while it is still recording."
    Hopefully the follow waypoints example script instructions above will help you get started

    "Just imagine an object starting following 5 seconds (or frames, or a random amount of time) later than the object it follows. I just cant make that."

    Just so that I understand correctly you would like to have some kind of time delay before the following starts? The follow waypoints script could be modified to trigger after a set amount of time. Want a hand with it? If so I'll see what I can put together this afternoon :)

    "The only way I found to start a ghost car when a lap is completed is with this code"
    Is this your end goal? Player races first lap, as soon as he crosses the line, a new waypoint group is triggered to start recording the new lap. Then the ghost car would start up. I like that useage of OMT! And I am sure it can be done.

    I would suggest creating a controller script that holds information about the laps (Lap number, lap duration, etc), and which waypoint group is associated with each lap. It could then tell the follow waypoints script which waypoint group the ghost car needs to follow, for example the fastest of the previous laps. I am happy to try and help.
     
  47. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Update for ishlilith
    "And the time scrub does not work, when enabling the scrubbing bar it sends the cube straight to the moon"
    I have found out what is happening. The script is currently setup to scrub the movement of the object that is currently being tracked. So when the scrub bar is enabled, this means you would be trying to move the object normally, and update it's position in the scrub bar. This clash is what causes it to shoot off. I am right now modifying the example script to behave better in this scenario and warn the user. Doing this has also highlighted a nice feature for OMT to have, in which there is an easy to access variable that shows which group is the current active waypoint group, instead to iterating through the groups. I will be adding it to the next release.
     
  48. ishlilith

    ishlilith

    Joined:
    Mar 16, 2012
    Posts:
    13
    I've managed to fix the follow script to how I think it should work.

    in FollowSetup()
    Code (CSharp):
    1.                     if(waypointFollowMode == WaypointFollowModeOptions.LengthLast)
    2.                     {
    3.                         indexCount = 1;
    4.                     //    indexCount = omtComponent.waypointGroups[i].waypointPosition.Count-1;    //Set indexCount to last index position
    5.                     }
    in MoveObject()
    Code (CSharp):
    1.                 //Move along waypoints starting at the last index
    2.                 if(waypointFollowMode == WaypointFollowModeOptions.LengthLast)
    3.                 {
    4.                     //If waypoint group ID matches and the index count has not reached 0
    5.                     if(waypointGroupToFollowID == omtComponent.waypointGroups[i].id && indexCount > 0)
    6.                     {
    7.                         int currentPoint = omtComponent.waypointGroups[i].waypointPosition.Count - indexCount;
    8.                         //If the object has not reached the waypoint position move again
    9.                         if (ObjectToFollowWaypoint.position != omtComponent.waypointGroups[i].waypointPosition[currentPoint])
    10.                         {
    11.                             ObjectToFollowWaypoint.position = Vector3.MoveTowards(ObjectToFollowWaypoint.position, omtComponent.waypointGroups[i].waypointPosition[currentPoint], moveSpeed * Time.deltaTime);
    12.                         }
    13.                        
    14.                         //If object has reached the position, chnage the index count and start moving to next waypoint position IF index count has not reached 0
    15.                         if (ObjectToFollowWaypoint.position == omtComponent.waypointGroups[i].waypointPosition[currentPoint])
    16.                         {
    17.                             indexCount++;
    18.                            
    19.                             if(indexCount > 0)
    20.                             {
    21.                                 ObjectToFollowWaypoint.position = Vector3.MoveTowards(ObjectToFollowWaypoint.position, omtComponent.waypointGroups[i].waypointPosition[currentPoint], moveSpeed * Time.deltaTime);                  
    22.                             }
    23.                         }
    24.                     }
    25.                 }
    That way the object starts at the last (the first in time) waypoint and follows all of them in order.

    Please create some helpers to at least get previous/next and first and last waypoint ( a simple point struct would do), start/stop the recording and get the waypoint groups.
    Yes, it's easy enough for us to do, but it would be easier to just call a function and get them.
    A further requests is the possibility to record custom data, or at the very least add another list for strings (or ints for enums, that would be faster) so that for example we can record the time or the exact frame of a crash or jump or shoot or whatever. Yes, I also know it's very easy to do by ourselves, but that would break in the next update.

    Thanks.
     
  49. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Update for ishlilith
    Glad you got it working! I have sent a new version to the asset store that improves the scrub bar in the time travel script, and adds a feature to OMT that allows user to easily access the index number of the active waypoint group. As for your other suggestions I have added them to a wish list and will see what I can do, as I think they are nice ideas!
     
  50. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi folks! Object Motion Tracker 2.1 is now up on the asset store. Thanks to all who bought it in the 24hr sale. I've had some great suggestions, and people are using it in ways I never imagined! If you are using Object Motion Tracker in any of your games let me know, and I'll try and give you a shout on the hexagonneuron.com website.