x


AddTorque doesn't rotate?

Their are no console errors but this is the line i'm trying to make and it wont rotate, also just so you know it's part of my airplane, which has a 1000 mass rigidbody, and its already got a 350000 force acting on it to move it fast so could this be effecting it?

if(Input.GetKey("d") && (groundtrigger.triggered==0))
{
rigidbody.AddRelativeTorque(Airplane.transform.right * -banking);
}

i just tried making a test and i put a script like this on a cube. and it worked... then i copied and pasted it and made so it would be focused the the airplane and it doesnt work, but if im on the ground and i the torque is like 20000000 it would jump into the air, why wouldn't it rotate like it is supposed to, i even erased the trigger part? so i dont have to worry about that.

more ▼

asked Apr 27 '11 at 09:22 PM

BrettRiet gravatar image

BrettRiet
49 12 12 19

first thing I'd check: is groundtrigger.triggered==0 true? Toss a print statement in there to ensure you're getting into the if statement.

Apr 27 '11 at 09:29 PM Chris D

Yea i know thats true, i just tried without it and it still wouldn't rotate.

Apr 27 '11 at 09:31 PM BrettRiet
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Does the rigid body have infinite air drag or is there a constraint on the rigidbody that locks rotation ? Also what is the nomenclature ? The script is applying a relative torque in the world right direction of an Airplane reference ?

try doing something basic first:: Airplane.rigidbody.addRelativeTorque( Vector3.right, 100000);

Sidenote: I prefer the style where the rigid body has low mass, and I account for the forces in my controller rather than have it on the rigidbody.

more ▼

answered Apr 27 '11 at 09:49 PM

Jeston gravatar image

Jeston
419 27 31 34

No... i dont know why it doesnt work i even check the max angular velocity in the phisics manager.

Apr 27 '11 at 09:52 PM BrettRiet

Doesn't work still?

Apr 27 '11 at 10:06 PM BrettRiet
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5268
x1858
x980
x68
x23

asked: Apr 27 '11 at 09:22 PM

Seen: 1409 times

Last Updated: Apr 27 '11 at 10:31 PM