Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to create heart rate GO

Discussion in 'Scripting' started by opwallin, Nov 18, 2015.

  1. opwallin

    opwallin

    Joined:
    Dec 27, 2013
    Posts:
    17
    Is there any guide to create heart rate using scripts in Unity3D ? It need to simulated based on protagonist state (is running is protagonist fighting or not etc).
     
    Last edited: Nov 18, 2015
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    Do you mean drawing this kind of animated image for UI / HUD.. or ?

     
  3. opwallin

    opwallin

    Joined:
    Dec 27, 2013
    Posts:
    17
    Yes. Using sprite sheets is one option not but is there any other way do it ? Using scritps using on magical maths funcs ?
     
  4. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    It might be possible to do it using a trail renderer particle effect on an empty and then have your code change the position of the particle effect depending on what the player does so you'd need to record the velocity for example of the player.

    However for specifics you'd have to talk to someone else as I'm still quite new to Unity.
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    moving gameobject with trail renderer might work well actually (you get the fading out effect automatically then )

    or get from asset store :)
    https://www.assetstore.unity3d.com/en/#!/content/6034

    other ideas
    - Drawing lines with GL ( http://forum.unity3d.com/threads/drawline-with-gl.235793/#post-1566858 )
    - Using shader ( https://www.shadertoy.com/view/4tS3W3 would need some modifications of course )
    - Having high resolution thin mesh and moving the vertices up & down ( wave mesh tuto http://gamedevelopment.tutsplus.com...amic-2d-water-effects-in-unity--gamedev-14143 )
     
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Just make a single looping image. Scroll the image faster or slower depending on the users heart rate.
     
  7. AJSSKlai

    AJSSKlai

    Joined:
    Sep 13, 2019
    Posts:
    1
    Hey know its been a while since the thread started, but how does do you scroll images?
     
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Transform.position...