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 gardian06 · May 23, 2013 at 03:05 PM · physicscontrollerflight

Flying movement

I am currently working on a flight type game where the user can adjust yaw, and roll (much like a single stick airplane). my initial implementation was using:

 void Update(){
     ...
     transform.position += transform.forward*currentFowardSpeed; // currentFowradSpeed:float
     
     float yAxisInput = Input.GetAxisRaw("Vertical");
     float xAxisInput = -Input.GetAxisRaw("Horizontal");
     
     transform.Rotate(new Vector3(1,0,0), yAxisInput * rotSpeed);
     transform.Rotate(new Vector3(0,0,1), xAxisInput * rotSpeed);
     ...
 }

but this does not actually utilize the RigidBody used for collisions/triggers effectively, and maintains turning radius regardless of the speed the craft is going at. what I want to do is something like:

 void Update(){
     ...
     yAxisInput = Input.GetAxisRaw("Vertical");
     xAxisInput = -Input.GetAxisRaw("Horizontal");

     Vector3 forward = transform.forward;
     // rotate forward in the direction of yAxisInput
     // rotate forward in the direction of xAxisInput

     rigidbody.velocity += forward *(currentFowardSpeed * Time.deltaTime);
     ...
 }

the closest I can figure for the comments standing in for the rotations is Vector3.RotateTowards(), but I am unsure of what arguments to give it. but I feel like those should be already rotated vectors, but that doesn't make sense to me directly as why don't I just use direct vector math to give my new forward vector, and then also use that as the force which goes back to not using the RigidBody to its full potential.

any help cleaning this up would be greatly appreciated.

Comment
Add comment · Show 7
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 AlucardJay · May 23, 2013 at 06:56 PM 2
Share
  • http://keithmaggio.wordpress.com/2011/07/01/unity-3d-code-snippet-flight-script/

  • http://forum.unity3d.com/threads/43984-Unity-testproject-a-little-flightsim

  • http://www.gotow.net/andrew/wordpress/?page_id=99

avatar image gardian06 · May 23, 2013 at 07:47 PM 0
Share

can you please explain what your answer means. because in all reality without context this looks like spam.

avatar image AlucardJay · May 23, 2013 at 07:52 PM 0
Share

How is it spam? The first link is a C# tutorial on exactly what you are trying to do. These are the best 3 flight tutorials I have come across....

As you are dissatisfied, I shall convert to a comment.

avatar image Vonni · May 25, 2013 at 05:23 PM 1
Share

Wow, he was just trying to help, and those links are helpful. Jesus...

avatar image AlucardJay · May 25, 2013 at 06:38 PM 0
Share

Comments that have since been deleted, but as reference to these other comments for future readers :


gardian06 :

my dissatisfaction is that you just through in a link to something without any explanation as to what it is, why I should look at it, or if I should look at the whole thing, or just a segment of it. for all I know I could have asked a question that could be answered in a code sample, and you might have given me a book when all I need is a paragraph from it. and this is presu$$anonymous$$g that the links given is even relevant, and not just I am just going to put a link here that has nothing to do with the question.

just throwing up a link is the same as saying "I don't feel the need to actually explain this, so just go read these volumes of information yourself." which as a $$anonymous$$ching moment is the worst thing to do.

this is all ignoring the fact that just a link is not an answer. an exert from a link (showing link as reference) is an answer. similar to a link to docs because if you look at any thread answered with just a link to the docs the very next reply about 80-90% of the time is "how do I use that in this context", or "I don't see how that helps", or nothing at all.

just at least tell me why I should care about a link that is given, or what part of the stuff on the other side I should even be looking at.

robertbu :

gardian06 - 1) He did not give it to you as an answer. He gave the information to you as a comment. You should not expect an "answer" from a comment. 2) Your question had not been answered after a full day, and far fewer questions that old ever get answered, but he took the time to find and post links to be helpful to you when no one else answered your question.


To be fair I did post as an answer (As you are dissatisfied, I shall convert to a comment.) , however this reply marks the end of my activity on UA, I'm fed up of the attitudes here and feeling like the bad guy. Thank you for your comments @Vonni and @robertbu , good luck for the future.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rubbery hinge joints 1 Answer

Character Controller children of a car: Inertia effect, delay effect, what??? 1 Answer

Dynamic flight physics help. 0 Answers

RigidBody controller - Where to start? 0 Answers

Character controller jittering up and down 2 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