Changing the Center of a GameObject?

Hey everyone

I made a little Pointer to display velocity on a dashboard. Since it seems that GameObjects always rotate around their Center (duh) i need an advice on how to optimize my script OR how to change the object's center

code :

if(Input.GetKeyDown("R"))
{
  transform.Rotate(0, 0, 0*Time.deltaTime);
}

I'm guessing people get this SO EXTREMELY UBER COMPLICATED script :p

thanks..

Biohazard

you should use better tags

2 Answers

2

Well, to change the "center," I assume you mean the pivot point, in which, you'll have to use a 3D program to do that. However, a small work around is make an empty object, then make that object a child of it, and you can use that as the pivot point.

And I don't understand the other thing? Optimize script to do what?

Nevermind, don't bother answering i found it out :P

Attached the script to my Object and used

`Input.GetKey`

instead of

`Input.GetKeyDown`

and called the function in

`function Update()`

Thanks anyways justin :)

@bio, I agree with Justin but I also think you should let it go. There's no need to be calling out stuff like that. It'll just pollute the community even more if it stirs up the soup.