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 RMihai · Aug 21, 2013 at 12:05 PM · floattorquegetaxismotor

Can you explain me please in more details what is motorTorque?

I'm begginer with unity, and i want to know what is motorTorque propriety from WheelCollider class. I have the following code: var maxTorque : float = 50; function Update() { WheelCollider.motorTorque = maxTorque * Input.GetAxis("Vertical"); }

Please explain me what motorTorque is and how it's work:)

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by c.rajiv.chandel · Aug 21, 2013 at 01:20 PM

This is value of force around wheel axis which make your wheel spin around this axis, bigger the value of motorTorque causes more rotation for longer period in front direction. And try to avoid using negative torque tough.

Comment
Add comment · Show 4 · 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 RMihai · Aug 21, 2013 at 01:41 PM 0
Share

Ok... so in my case the wheel will spin around it's axis 50 times/frame? Please help me, i really can't understand. and thank you for the replay:)

avatar image c.rajiv.chandel · Aug 21, 2013 at 07:00 PM 0
Share

Let me try to explain you lit bit in more detail:

     var wheel : WheelCollider;
     var $$anonymous$$OTOR_$$anonymous$$AX = 10;
     private var motor = 0;
     
     function FixedUpdate () {
      
     motor = $$anonymous$$athf.Clamp(Input.GetAxis("Vertical"), 0, 1);
     wheel.motorTorque = $$anonymous$$OTOR_$$anonymous$$AX * motor;
      
     }

The FixedUpdate function is the most important part of script. The FixedUpdate function is run once every frame that the physics of the scene is updated.

In the function I grab the user input for motor. you can use W and S keys for input. Input.GetAxis(“Vertical”) gets W and S key presses. In this case you can use W to apply the accelerator and S to apply the brake. So we have clamped, or restricted, the vertical input returns so I know when they are positive (the W key, going forward) and negative (the S key, going backward or braking).

With the user input given on motor. you can then apply those to the wheel colliders. The motor torques are applied to wheel. motorTorque is property of the Unity wheel collider. This is how we can use this. hope this answers your question.

avatar image RMihai · Aug 22, 2013 at 04:34 AM 0
Share

$$anonymous$$uch better..... thank you so much! You make my day!:)

avatar image c.rajiv.chandel · Sep 03, 2013 at 03:23 PM 0
Share

my pleasure, if my answer is acceptable to you then you can accept it as answer of your question, if you have some time.

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

16 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 avatar image

Related Questions

Can I emulate simple space-like gravity? 2 Answers

Unity3d fails when uses float value. 1 Answer

I dont want Decimals :P 1 Answer

Shooting. Bullet floats and sprays 1 Answer

How do I sort floats by highest to lowest value? 1 Answer


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