• 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
Question by Chimera3D · Jun 04, 2012 at 01:39 AM · velocitytorqueincreasemaxangular

Adding More Torque

How is it possible to add more torque to an object in short bursts, increasing the value does nothing and changing the max angular velocity doesn't work either. I've already increased the max angular velocity but what I need is for when the player presses a button they'll move faster, as I've already stated trying to increase the max angular velocity in code doesn't work and you would have to speed up other objects' angular velocity. I'm just asking for an explanation, not code or anything.

Comment

People who like this

0 Show 5
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 Chimera3D · Jun 08, 2012 at 02:46 AM 0
Share

Is there no way that this can be done?

avatar image Chimera3D · Jun 19, 2012 at 09:57 AM 0
Share

If there is no way this can be done, can I somehow fake it. If I use addForce it produces a unrealistic effect, I don't know what to do.

avatar image Tim-Michels · Jun 20, 2012 at 10:17 AM 0
Share

Is it really necessary to use physics? Otherwise I could give you some pseudo-code on how to write your own rotation code.

That way you have full control over the rotation and its speed.

avatar image Chimera3D · Jun 22, 2012 at 01:52 AM 0
Share

I want the character to be completely physics based along with most other things in the game.

avatar image AlucardJay · Jun 22, 2012 at 06:05 AM 0
Share

torque needs to build up to work, one instance for one frame only won't 'twist' the character. in a new scene, create a cube with rigidbody and mass 1. add the following script to the cube. then create another larger cube for the floor, add rigidbody and set to is kinematic - true :

 public var turnForce : float = 1000.0;
 private var moveX : float = 0.0;
 
 function FixedUpdate() 
 {    
     moveX = Input.GetAxis ("Horizontal");
     rigidbody.AddTorque( Vector3.up * moveX * turnForce * Time.deltaTime );
 }

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by Tim-Michels · Jun 22, 2012 at 06:29 AM

Well, you're right about the maximum angular velocity. You should definately raise that value if you want stuff to rotate faster.

The next important thing you should know it the way you apply the force. When you use AddTorque, this is indeed a force that needs to build up, but you can also pass a ForceMode parameter.

You should test some stuff with:

rigidbody.AddTorque(100, 0, 0, ForceMode.Impulse);

When you're only applying the torque once, and not every frame, you don't have to take Time.deltaTime in account, because the framerate doesn't matter for an impulse force.

Cheers

Comment

People who like this

0 Show 0 · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Increased projectile velocity when holding button down 2D 1 Answer

Conserving rotational momentum 1 Answer

Wheel Collider Stops Accelerating 0 Answers

eliminating angular velocity when clamp value hit? 0 Answers

Maximum angular velocity of specific local axis. 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