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 Jakester1013 · Dec 28, 2013 at 05:47 AM · rotationspriterotation axis

Rotating a 2D sprint IN THE CENTER in 4.3

Hello everyone!

I have a question in regards of what I am trying to do.

I want to rotate a waterdrop sprite, but I want to have it rotate not around the axis of the game, but the center axis of the water drop sprite itself. I know that normally that I'd have to have a collider in a 3D object in order to rotate an object in the center, but since its in 2D, that doesn't seem to be the case. Is there a way to do it in the 2D setting?

Any input is gladly appreciated.

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
0
Best Answer

Answer by Eric5h5 · Dec 28, 2013 at 06:28 AM

Use Transform.Rotate; whether it rotates around the center depends on where you put the pivot point. You never need a collider in order to rotate objects, 3D or otherwise.

Comment
Add comment · Show 4 · 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 Jakester1013 · Dec 29, 2013 at 01:03 AM 0
Share

Ok so I do that, but how do I make the pivot point at the center of the sprite? I used Vector3D.forward and Vector3D.back in that function before and it rotates around a axis, but not on the center of the sprite like I wanted to.

avatar image Eric5h5 · Dec 29, 2013 at 01:13 AM 0
Share

Set the pivot point in the inspector, using the pivot drop-down.

avatar image Jakester1013 · Dec 29, 2013 at 07:19 AM 0
Share

So I managed to get that fixed. I got it accomplished by making a empty game object, making it the child of the object that I'm trying to rotate, and put it where I wanted the object to pivot at and did the rest in code. Thanks a bunch for setting that idea in motion!

avatar image Eric5h5 · Dec 29, 2013 at 09:12 AM 0
Share

It would be a lot easier if you just set the pivot point in the inspector.

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

19 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Animated Sprite Rotating Around It's Own Axis Instead Of Parent's Using Script. Details Provided. 0 Answers

Need help with sprite rotation 0 Answers

Change the Material of a Sprite with C# 1 Answer

Rotating sprite through touch (storing current rotation) 0 Answers

Problem when i rotate a 2d object aroun Z-axis 1 Answer


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