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
2
Question by himanshu619 · Oct 12, 2012 at 06:35 PM · gameobject.tag

How to rotate game object on fixed position

Hi can anybody please tell me that how to make game object rotate on fixed position! Please
tell me the full procedure with steps as i'm beginner to unity.

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

1 Reply

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

Answer by aldonaletto · Oct 12, 2012 at 09:37 PM

You should use transform.Rotate - this rotates the object without modifying its position. If you want the object to spin continuously around the Y world axis, for instance (script attached to the rotating object):

 var rotSpeed: float = 60; // degrees per second

 function Update(){
   transform.Rotate(0, rotSpeed * Time.deltaTime, 0, Space.World);
 }
Comment
Add comment · Show 3 · 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 himanshu619 · Oct 13, 2012 at 07:49 PM 0
Share

O$$anonymous$$G! It's really working! Thanks a lot......

avatar image himanshu619 · Dec 16, 2012 at 08:52 AM 0
Share

Dear Aldo, Can you tell me how to add animation to my coin while player collect it (something similar to Temple run).

avatar image aldonaletto · Dec 16, 2012 at 12:24 PM 0
Share

I suspect that Temple Run uses a simple particle effect: the coin is destroyed and a single particle is instantiated to replace it and do the animation. Using the old ParticleEmitter, this could be done in the OnTriggerEnter event in the coin script:

 var effect: ParticleEmitter;

 function OnTriggerEnter(other: Collider){
   if (other.tag == "Player"){
     // create effect at coin position and with player rotation
     Instantiate(effect, transform.position, other.transform.rotation);
     Destroy(gameObject); // coin suicides
   }
 }

You should create the particle effect so that it emits a single particle to the left and with a down velocity that will make it fall, and use the coin image. If you don't know how to do this, post a new question - this subject is too complex to be handled in comments!

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

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Detect a gameObject's tag via OnCollisionEnter() 5 Answers

Help with string to gameObject.name 2 Answers

Trying to make the enemy fire 1 Answer

[C#] Raycasts and Object Tags 1 Answer

Need help finding the closet player to an enemy 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