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

Resolved Need help with 'gliding' code in Bolt

Discussion in 'Visual Scripting' started by littnuke, May 27, 2022.

  1. littnuke

    littnuke

    Joined:
    May 27, 2022
    Posts:
    4
    i am making a 2d game in bolt and am having trouble with this script,i want to set the mass to the variable(hence making it glide due to less gravity acted on it) when it isnt touching the floor and is holding shift, does anyone know what is wrong with the code/graph?

    Edit:fixed,now can glide, uploaded new code for future reference image_2022-05-27_162355765.png image_2022-05-27_172744078.png
     

    Attached Files:

    Last edited: May 27, 2022
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    If you have a problem with visual scripting then you should post in the Visual Scripting forum please. I'll move your post for you.

    NOTE: You have a misconception if you think the mass has anything to do with how much gravity affects it; it doesn't. If you want to reduce gravity on a Rigidbody2D then reduce the Rigidbody2D.gravityScale.
     
  3. littnuke

    littnuke

    Joined:
    May 27, 2022
    Posts:
    4
    thank you! i will try it now to see if it works
    Edit:it keeps saying that the input key (Fire3 because i think that is shift) is unknown

    Edit 2: I fixed it and now i can glide
     
    Last edited: May 27, 2022