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 zerofiftyone · Mar 04, 2014 at 05:45 PM · rotate objectpathcirclecircular

Having trouble with implementing circular player movement

Hello all. I'm pretty new to Unity and a complete beginner when it comes to programming, so I'm looking for some help with a problem I'm having.

I'm trying to create a control method whereby the player moves in a circular motion, along the path of a several concentric rings. I was able to get movement from ring to ring working, but I'm having trouble getting the circular motion working correctly.

After a couple of false starts I found a script here which seemed to be just what I needed. It works for the most part; however the problem I'm having is that any left/right movement will gradually cause the player to drift out of orbit.

Here's a web player link, it may describe the problem better than my summary.

I also tried an implementation whereby the player gameobject is parented by an object in the centre which does all of the rotation, causing the player to rotate around it; but this gives me trouble when changing the player's distance from the centre. The speed increases the farther out the player moves, which is undesirable, as I need the player to have a uniform movement speed. Web player example of this attempt.

Does anyone have a solution which could help?

Edit: Fixed links.


Thanks for reading,
Ben Wilson (zerofiftyone)

Comment
Add comment · Show 2
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 robertbu · Mar 04, 2014 at 05:47 PM 0
Share

Your dropbox links are broken, so we cannot see what you are asking about.

avatar image zerofiftyone · Mar 05, 2014 at 02:28 PM 0
Share

Ah, well spotted. All fixed now, thank you.

1 Reply

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

Answer by flarespeed · Mar 04, 2014 at 06:21 PM

I would try making an equation which slowed the rotation of the parent GameObject relative to the circumference of the orbit.

"Rotation speed" = "Initial speed" / 2 π r

I think I got this equation right, not entirely sure. Symbol is pi, and r is the distance of the player from the center, in case anyone is confused.

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 zerofiftyone · Mar 05, 2014 at 02:31 PM 0
Share

A friend of $$anonymous$$e suggested that too. I will try it this evening once I get home from work. Thanks for your time.

avatar image zerofiftyone · Jun 17, 2015 at 01:49 PM 0
Share

I picked this project back up recently; currently remaking it in Unreal Engine. Anyway, just wanted to say thanks for your help! Revisiting this post saved me a lot of time otherwise spent figuring it out; I am the worst at maths.

Thanks again, Ben

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

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

Related Questions

progressive circular player movement 1 Answer

How to Draw a 2D Circle for my level border? 2 Answers

the specified path is not of a legal form 1 Answer

How to write a script to destroy enemy once player circles around 1 Answer

How can i loop my path instead of it ending on the lasat point 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