Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Running haptic thread in unity scene at 1000HZ

Discussion in 'General Discussion' started by dm0012, Mar 26, 2024.

Thread Status:
Not open for further replies.
  1. dm0012


    Mar 29, 2022

    I am currently working on a medical simulation scenario in Unity3D (version 2021.3.21) that incorporates haptic feedback using the Touch Haptic Device (Phantom Omni). I am utilizing the OpenHaptics plugin for Unity to achieve this functionality. Although I have successfully connected the haptic device to Unity and can manipulate it within the scene, I have encountered an issue where the feedback does not feel smooth and instead feels jerky when I apply forces to the haptic device.

    Currently, the haptic device is represented as a rigid body, and forces are applied using the RigidBody.AddForce() function that runs within the FixedUpdate() method.

    I am interested in exploring options to potentially run the haptic code in a separate thread to ensure that it runs at a consistent rate of 1000Hz, thereby providing real-time feedback.

    I would greatly appreciate any suggestions or guidance on how to achieve this smoother haptic feedback experience.

    Thank you for your assistance.
  2. Antypodish


    Apr 29, 2014
    Unity isn't suitable for that kind off application.

    There is tons of things which can iterupt and distort results on such high frequencies.

    If you want real time data, you want to build, aquire real time monitoring hardware. Perhaps even arduino could be suitable for that. Then captured signal can be compressed and smoothed out, then sent approximation to Unity for visualisation.

    Mind that Unity predominantly is a Game engine. Not a medical device.

    You can also try to checkout robotic sub forum, for any directions.
  3. MelvMay


    Unity Technologies

    May 24, 2013
Thread Status:
Not open for further replies.