x


How to make the same rotation speed?

hello everyone.

I make a script at my protagonist. If my protagonist in to a object.tag=StartRotation.

He will begin to rotate.

function OnTriggerStay (other : Collider) {

if(other.gameObject.tag=="StartRotation"){

transform.Rotate(Vector3.forward*Time.deltaTime*500, Space.World);

}

}

I have a problem is everytime when I in to the "StartRotation",my rotation speed can't be equal speed.(sometime fast,sometime slow) And now I hope the rotation speed can be equal speed.

so...how can I do?

more ▼

asked Jun 01 '11 at 08:20 PM

ZroeX gravatar image

ZroeX
77 14 17 21

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

it's difficult to understand what you're trying to do, but a precursory look at your code tells me that you're going to get inconsistent rotations because you're using transform.forward. When you enter a trigger, it's going to be different every time depending on the direction you're facing.

more ▼

answered Jun 01 '11 at 08:49 PM

testure gravatar image

testure
4.2k 20 25 48

Sorry about my question,I just want to the rotate speed can be the same when I enter everytime. Your answer mean...if I want make same rotate speed ,I can't use transform.forward?

Jun 01 '11 at 09:05 PM ZroeX
(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:

x2173
x358

asked: Jun 01 '11 at 08:20 PM

Seen: 905 times

Last Updated: Jun 01 '11 at 09:26 PM