Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by user-3061 (yahoo) · Jul 05, 2010 at 08:22 AM · airplanehelicopter

Flying/hover script?

Hi, i have been making a game with a hover and helicopter. with my script here

using UnityEngine; using System.Collections;

public class ThrusterScript : MonoBehaviour { // declare the variables public float Speed = 9; public float Drag = 20; public float DragNoMovement = 50; const float airDrag = 0F;

void FixedUpdate () { // get the inputs float horizontal = Input.GetAxis ("Horizontal"); float vertical = Input.GetAxis ("Vertical"); float altitude = Input.GetAxis ("UpDown");

   // check to see if the user is moving
   bool userMoved = Mathf.Abs (horizontal) > 0.1F || Mathf.Abs (vertical) > 0.1F || Mathf.Abs (altitude) > 0.1F;

   // determine the force vector
           float x = horizontal * Speed;         
   float z = vertical * Speed;
   float y = altitude * Speed;
   rigidbody.AddRelativeForce (new Vector3 (x, y, z), ForceMode.VelocityChange);

   // apply the appropriate drag when moving
   if (userMoved)
      rigidbody.drag = Drag;
   else
      rigidbody.drag = DragNoMovement;

}

void Start () { if (rigidbody==null) gameObject.AddComponent ("Rigidbody");

   // don't let the physics engine rotate the character
   rigidbody.freezeRotation = true;

} }

It gave me a ton of errors.How can i fix it? And if possible, could anyone give me a script for aeroplanes/hover/helicopers? I saw the helicopter script from Andrew Gotow, but i cant get it to work.Please help, really need it, thanks.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image qJake · Jul 05, 2010 at 09:29 AM 0
Share

"It gave me a ton of errors" is NOT helpful at all. What errors, specifically, did you get? -- And no, noone will "give you a script", you need to write your own code, we don't do your work for you.

avatar image aman_jha · Aug 28, 2012 at 01:53 PM 0
Share

@SpikeX

go eat peanut butter and shut up

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by TaigaStudios · Jul 06, 2010 at 08:06 PM

As SpikeX be more specific of your errors and first give it a try to solve the problem yourself. If youre using someone else's tutorial take the complete project and edit for your needs to avoid typo errors. Here is a list of Vehicle Tutorials For your project i would recommend the third link (car tutorial) which leads you to page where you can find helicopter tutorial. Here's DL for the Helicopter Tutorial

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mani · Nov 24, 2010 at 03:26 PM 0
Share

Thanks for the endorsement Taiga Studios!

avatar image aman_jha · Aug 28, 2012 at 01:54 PM 0
Share

This is a HELP AND ANSWER FORU$$anonymous$$!!! not tell other people to do it them self site

avatar image Mander · Aug 28, 2012 at 01:57 PM 0
Share

@yoman encouragin ppl to learn for themselves is helping.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

How to make objects invisible on collision? 2 Answers

Spawning Zombies Different Rounds 2 Answers

AI damage problem 0 Answers

How do i make a fighting system like in oblivion? 1 Answer

Rotating a camera when RMB is held down. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges