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 VictorVaeVictis · May 11, 2014 at 09:31 PM · multiplayerfpsgravity

How do you change the direction of gravity?

I'm looking to make a multiplayer game where each character has a different gravitational pull. For instance, player 1 walks on the floor, while player 2 walks on the ceiling, player 3 walks on the east wall, etc. But I just can't seem to figure out how to change the direction of gravity on any particular character. Any help is 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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by oliver-jones · May 12, 2014 at 04:18 PM

You can change the Vector3 direction of the gravity in Editor > Project Settings > Physics.

alt text

In your case, you want the Y axis to be positive 'something'. 9.81 if you want real world physics - but going the other way.


screen shot 2014-05-12 at 17.16.09.png (43.8 kB)
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 VictorVaeVictis · May 13, 2014 at 09:40 PM 0
Share

Problem is this affects the entirety of the world physics... However I want several different players to each have their own direction of gravity. Pretty sure if I adjust these settings I'm just going to have every player walking across the ceiling.

avatar image Kiwasi · May 13, 2014 at 10:16 PM 0
Share

You can set gravity to -ve on a rigid body. This give you two options. Otherwise its disable gravity and custom addforces

avatar image
0

Answer by Jeff-Kesselman · May 11, 2014 at 09:32 PM

The short answer is, you don't use Unity's world-gravity.

You code a gravity vector for each object in a script and, in the script's FixedUpdate call back, you apply the vector times the elapsed time as force to your object.

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 VictorVaeVictis · May 11, 2014 at 09:46 PM 0
Share

It appears gravity is controlled by the character controller. So does that mean I need to write my own character controller or can I either adapt the one provided by unity to do it, or disable gravity in the character controller and write a gravity script?

avatar image Jeff-Kesselman · May 13, 2014 at 10:05 PM 1
Share

Yes, Character controllers don;t use the pHysics system. They do all their own calculation.

Unfortunately they aree one of the few parts of the system that are not implemented as a script so you cannot modify theirs.

Either you writ your own OR you try writing a secondary script that applies forces to balance the forces being supplied by the character controller.

Character controllers are basically evil. They are black boxes with their own behavior that is not necessarily fully documented. I always write my own control logic to avoid the pain of having to fight with them.

avatar image getyour411 · May 13, 2014 at 10:06 PM 1
Share

You need to write your own, the Unity CharacterController gravity is not tweakable

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

25 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

Related Questions

How to make a camera work in this circumstance. 1 Answer

Find closest transform 1 Answer

Database connection FPS game? 0 Answers

Problem with identifying players in network 1 Answer

AudioMixer Snapshot Problem 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