• 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 BritishGuy · Jan 25, 2015 at 01:21 PM · rotationgravityspacespaceshipartificial

Artificial Gravity "SpaceShip"

Hello.

What would be the best way to go about adding artificial gravity to a moving spaceship that is rotating around all axis.

at the moment i have disabled the world gravity, parented my character to the ship and applying a down force to keep me grounded and upright, But it is not without its problems like walking on interior walls and such "not intended"

Would it be best to just apply the worlds Physics.gravity to the rotation of the spaceship and use a rigidbody character controller? if so, how could i achieve this effect? "ship rotation = gravity rotation" Thanks.

If anyone has any better ideas or suggestions i would greatly appreciate it, thanks.

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 BritishGuy · Jan 25, 2015 at 02:16 PM 0
Share

ok i managed to get gravity to rotate with my ship so i stick to the ground, 1 problem though, my characters rigidbody pulling down on the spaceships 0 gravity rigidbody i am pulling the ship down with my gravitational force, So i need to reside to an alternative method of doing this, Any ideas would be greatly appreciated, thanks.

avatar image Glurth · Jan 25, 2015 at 05:13 PM 0
Share

Every action has an equal and opposite reaction.

You will need to apply an equal force in the opposite direction for the ship to stay in place. How to do this.. hmm. AddForce(), in the opposite direction of gravity obviously, but how do we know how much force? Perhaps; Physics.gravity* (-1*player.rigidbody.mass)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by wibble82 · Jan 25, 2015 at 10:43 PM

have you considered keeping the ship static, and simply rotating the camera / scenery to give the illusion of motion. I don't know anything about your game so don't know how appropriate that'd be, but it's a common trick to get this type of effect - less worrying about the direction of gravity and the effect of lots of dynamic bodies bouncing around.

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 BritishGuy · Jan 25, 2015 at 11:47 PM 0
Share

Not sure how i would achieve that to be honest, I was told to make a copy of main ship off scene static with my character controller on there while the camera was on the moving ship, The problem is i am using a Floating Origin so every so many units everything gets shifted back when the ship resets to 0,0,0

My project so far is beautiful, A full scale solar system for exploration in a Cruise / Light / Hyper-speed ship, So far the engine has kept up with the 1,000,000,000,000 m/s velocity, runs very smooth too, just a few hitches here and there such as this character controller and gravity issue.

I have attempted the "cloned static ship" approach but i just cant get to grips with it, It baffles me as to how i would keep a camera on a moving ship while the rigidbody character is sitting in a fake ship, Could you maybe shine some light? Thanks.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

22 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

Related Questions

G Force Acceleration 0 Answers

Drift Rotation 1 Answer

Space ship controls locking into place 1 Answer

Constant 3D rotation (torque, angular acceleration, etc) GLOBAL to object in space? 1 Answer

How can I make an efficient, yet accurate planetary orbit using Apoapsis and Periapsis distance from an object I am orbiting 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges