Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 h4wkeye · Apr 21, 2011 at 12:12 PM · gameobjectcenter

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

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 Aldwoni_legacy · May 04, 2011 at 12:30 PM 0
Share

you should use better tags

2 Replies

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

Answer by Justin Warner · Apr 21, 2011 at 12:17 PM

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?

Comment
Add comment · Show 1 · 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 h4wkeye · Apr 21, 2011 at 12:20 PM 0
Share

i was wondering if i should EITHER change my object OR my script to make it rotate alright. thanks for the anser, bot how do i actually set the pivot point? my Pointer is made out of a flattened cylinder and a lengthened Cube, so if i attach the rotationscript to the cylinder it'll be fine?

That would be awesome

avatar image
-1

Answer by h4wkeye · Apr 21, 2011 at 12:32 PM

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 :)

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 Justin Warner · Apr 21, 2011 at 12:39 PM 4
Share

For next time, use the Add Comment below =). I personally couldn't care less, but some people on here hate it when people add a reply as an answer. Just a heads up. And ignore that Bob guy... (He needs anger management, if you look at his past answers sometimes, wow).

avatar image Statement · Apr 21, 2011 at 04:53 PM 0
Share
@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.

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

No one has followed this question yet.

Related Questions

A node in a childnode? 1 Answer

How to set image in Aspect fit on Texture2D 0 Answers

Collecting game objects in specific order 1 Answer

C# Check If Gameobject is within Collider 1 Answer

How could it be done "Cooldown" for a shield ? 2 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