Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Calculate an Object Y Velocity with VS

Discussion in 'Visual Scripting' started by HAMSOFT, Feb 7, 2023.

  1. HAMSOFT

    HAMSOFT

    Joined:
    May 31, 2020
    Posts:
    32
    Hii,

    I'm trying to set a Jump animation for my player and for that I need to set an animator VerticalVelocity variable getting the velocity of the player in Y. How could I translate this code to VS?

     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    Just get the y value of the rigidbody?
     
  3. HAMSOFT

    HAMSOFT

    Joined:
    May 31, 2020
    Posts:
    32
    With a new variable, right?
     
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,367
    In Visual Scripting, it should be something like rigidbody.velocity => Split Vector 3 => just the Y part.
     
  5. HAMSOFT

    HAMSOFT

    Joined:
    May 31, 2020
    Posts:
    32
    I need that the final value gets to 0, but it doesn't
    upload_2023-2-7_21-34-2.png