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 Not_Sure · May 31, 2014 at 11:24 PM · vector3gravitydirectionanglechange

Why does gravity's vector3 act so weird?

So I was wanting to play around with gravity and change the direction using the vector 3 so I did this:

     function Start () {
          Physics.gravity = new Vector3(1f,0f,1f);
          }


And applied it to a cube, stretched out to a plain. Then I put a sphere on the plain with a ridged body.

When I hit play I noticed two immediate issues. 1) The sphere didn't rotate. It just slid along the plain. 2) The sphere continued its course in heading down x and z plains, but didn't drop when it went off the edge of the plain.

I then tried the same by removing the code and then just tilting the plain and camera and got the results I expected.

What's going on here? Is the gravity's Vector3 not really changing gravity's direction?

Thanks!

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

Answer by Bunny83 · May 31, 2014 at 11:42 PM

Grafity don't really act weird and changing Physics.gravity will change the direction and value of gravity. The only thing that looks weird where is your gravity vector. You changed it from the default {

     Vector3(0f, -9.81f, 0f);

to

     Vector3(1f, 0f, 1f);

which looks a bit weird ;)

First of all you changed the value from 9.81 to 1.414. Second your gravity vector now points 45° forward-right.

I'm not sure what you want to do here and what's the "results you are expecting", your vector just looks strange.

How is your plane oriented?

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 Not_Sure · Jun 01, 2014 at 12:11 AM 0
Share

Oh, man. I feel stupid.

This makes sense.

Thank you.

EDIT: Hmm... Now I just need to write a code to change the only x on a key down and only the z on another.

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

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

Angle Of Ray 2 Answers

How to get offset postition after rotation ? (Spent hours figuring it out) 3 Answers

Get Direction from 2 Vectors - and Apply to Transform 0 Answers

how to find direction between two points 2 Answers

Applying force with respect to angle with the ground? 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