Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 OoglyWoogly · Apr 13, 2011 at 11:13 AM · rotationaddtorque

AddTorque has no effect

Hi all, I am in the process of re-enginnering my project from transform based movement to addforce/torque based movement.

So far the addForce is working fine but i cannot get my object to rotate at all using AddTorque.

Here is the code I am using to move the object:

function FixedUpdate() {

 horMovement = Input.GetAxis("Horizontal");
 verMovement = Input.GetAxis("Vertical");

 if (verMovement) {
  rigidbody.AddTorque(transform.right * verMovement * verAcceleration);
 }

 if (horMovement) {
 rigidbody.AddForce(Vector3(0, horMovement, 0).right * horAcceleration);
 }

}

verMovement and horMovement are both set to 5.0. Can anyone tell me why it wont rotate? Thanks

Comment
Add comment · Show 1
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 Proclyon · Apr 13, 2011 at 11:32 AM 0
Share

Edited the answer I posted. Posting this comment as an auto-bump

3 Replies

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

Answer by OoglyWoogly · Apr 13, 2011 at 12:48 PM

Oh.... my.... god. I just found out the problem... and your gonna laugh.

I went into project settings physics manager, and set max angular velocity from 0 to 500 and it instantly worked. May have been a bit fast with a rotation speed of 1000000.0 but this can be easily changed. Im such a noob sometimes.

Thanks for all the assist.

Comment
Add comment · Show 2 · 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 svendkiloo · Mar 02, 2016 at 08:57 AM 0
Share

I actually had the same problem, but because it was in Unity 5 the solution is slightly different. The max angular velocity is set on each RigidBody and, as far as I can see, needs to be set from code.

avatar image BootySmashDeluxe · Nov 28, 2020 at 02:35 AM 0
Share

In unity 2019.3 its Project Settings -> Physics -> Default $$anonymous$$ax Angular Speed (near the bottom)

avatar image
1

Answer by Proclyon · Apr 13, 2011 at 11:14 AM

Are you sure you are overwhelming the inertia of the object in your virtual environment ?

EDIT 4/13/2011 13:31 GMT+1

I believe another question on the site has the code and the discussion you need. This isn't a real double but it's good enough I believe, but you will have to judge that for yourself.

http://answers.unity3d.com/questions/51353/force-and-rotation

Hope it works out!

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 OoglyWoogly · Apr 13, 2011 at 11:22 AM 0
Share

I think so. I just put verAcceleration up to 100000.0 and nothing happened so I think it is a problem with my code rather than the variables.I also just discovered that I had my X and Y axes constrained for rotation in the rigidbody inspector panel, so i unticked these but still nothing

avatar image OoglyWoogly · Apr 13, 2011 at 11:48 AM 0
Share

Had a look at that edit you sent me and it still doesn't work. This is really odd.

avatar image Proclyon · Apr 13, 2011 at 12:12 PM 0
Share

Consider building a $$anonymous$$iature testcase. I always run two projects. The real deal and a simulation area in which I tweak one variable at a $$anonymous$$m and observe the changes. This takes a lot of work but it never let me down. That is the only other advice I can give you right now. I do hope that it is as usefull for you as it has been for me.

avatar image OoglyWoogly · Apr 13, 2011 at 12:41 PM 0
Share

I am using a test scenarion at the moment unfortunately. Just tried to put it into another blank scene to make sure there werent any weird variables affecting it but still no rotation from AddTorque. Is there a setting that can prevent torque from being added?

avatar image
0

Answer by Dr_D · Apr 20, 2016 at 03:34 AM

Maybe it's just me... but this seems to only work in FixedUpdate(). At least that's what I've found. Maybe it's a bug? I looked through the docs... not super thoroughly, but it doesn't seem to be stated anywhere.

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

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Use RigidBody.AddTorque with Quaternions or Forward/Up/Right vectors? 2 Answers

Issue with Rotation behaviour of PID Controller when rotating to look at mouse position 0 Answers

How to rotate with a Pid controller 0 Answers

Flip over an object (smooth transition) 3 Answers

AddTorque to rotate rigidbody to look at a point 3 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