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

Wings Fly System

Discussion in 'Scripting' started by Nickk888, Apr 10, 2015.

  1. Nickk888

    Nickk888

    Joined:
    Apr 10, 2015
    Posts:
    4
    Hello dear Unity community!

    I hope you can help me because i search and try to do it myself but i can't find anything...
    I try to make my character to fly using his wings, the wings i want to use will be an animation but i want that my character fly up if i push a button(In my case the "Space" button), i want that it fly like a Dragon or a bird with using the gravity and aerodynamic.

    My character has a rigidbody and i try myself to change the mass of my character while flying and push my character up while pushing the Space button, but it looks very bad and ugly... And in some point the gravity always win with my character if i try to fly 3-5 times in 1 second delay then my character falls on the ground.

    I hope you can help my that my character can fly like a real bird, i'm not the best at Unity scripting but i understand C# well, but i just don't know how i must begin with the code.

    So, thats the code for the "hovering" i was trying to use but it doesn't work well...
    Code (CSharp):
    1. rig.AddForce(0, WingVelocity, 0);
    Here is a video how i want it to look like(Only the flying part!):


    PS: Sorry for my bad english, i'm german.
    Regards!
     
    Last edited: Apr 10, 2015
  2. Nickk888

    Nickk888

    Joined:
    Apr 10, 2015
    Posts:
    4
    Anyone can help me?