Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 cydonia · Jun 20, 2019 at 06:38 AM · scripting problemgravityfirst-person-controllermovment

walking inside curved surface

Alright i'm working on a scene where the player has to be able to walk along the inside of a giant cylinder. I'm unsure how to go about this. I can't turn off global gravity because other scenes need the normal gravity.

Ive looked into spherical gravity and ray casting but I have no idea how to implement the latter and the former doesn't work for what I need. I also thought about moving the cylinder under the player, not sure if that would work or if it would cause performance issues as it has a lot of object on it's inner surface.

I just need a way to stick the First Person controller to the surface so they can walk around and jump regardless of their orientation. So basically gravity emanating from the central point out. Ive been battling with this for a while and my brain is fried. I usually don't get answers on Answers but hey it never hurts to try.

This is still an issue I am having a hard time figuring out.

This is still an issue and I have not come any closer to figuring it out. I have lost all hope in Unity Answers actually being helpful but i'm at a loss so I will continue to ask questions into the void and not expect a helpful response.

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 cydonia · Jul 13, 2019 at 05:16 AM 0
Share

I'm still in need of help.

I'm now thinking the easiest option would be to have the cylinder rotate as the character walks along a specific axis, so if the character walks "up the side" it's just rotating under them to give the illusion of walking up the side.

However i'm not sure how to do that.

avatar image cydonia · Aug 01, 2019 at 07:29 AM 0
Share

Still having issues here, Just need to figure out how to move along the inside a curved surface. Bonus points if it works as the tube is rotating.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dbchest · Jul 13, 2019 at 07:31 AM

@cydonia my suggestion is to use custom script to disable the gravity to the player's Rigidbody. I would log that moment with a boolean, at which time you will need to simulate gravity along the correct axis. according to my research, gravity is applied in unity via simple Vector3 along the y-axis at a value of -9.81, so if you disable the player's "use gravity" option for his Rigidbody and replace it using the "AddForce" method within "FixedUpdate" you should be able to convincingly emulate gravity along a different axis. try each force mode to find the most suitable.

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 cydonia · Jul 17, 2019 at 11:01 AM 0
Share

Alright That's a good start, however I have no idea how to do that. the issue is I know what I would like to do but no idea how to do it. $$anonymous$$ind of like if I need to get out of prison and when I ask for help I'm just told "simply get out of prison" but in my head.

At this point I'm thinking an easy option would be to rotate the cylinder on it's axis as the player controller moves simply bypassing the need to change gravity. But despite knowing what I need to do I have no idea how to script it. $$anonymous$$y C# is very basic.

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

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

Related Questions

Isuues with Gravity in Unity 5 1 Answer

fill a script from the FirstPersonController script 0 Answers

How to fix initial gravity problem? 1 Answer

time dilation & gravity Effect Not working propperly 1 Answer

How do you allow the joints in a character to freely fall based on gravity? 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