Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 VSuper · Feb 08, 2015 at 04:02 PM · physicsrigidbodygravityforcefly

Problems making a glider

Hello, I have problems to realize my glider. In fact, I do not use the normal gravity of the rigibodies but an artificial gravity around a planet.

Gravity is a force of 10 that attracts the glider to the ground. It runs automatically to be at least horizontal with the ground.

I wish the glider performs circles smaller and smaller until it touches the ground.

Exemple: alt text

I tried many ways to do this:

  • A force that will cancel the attraction of the soil gravity (if the anti gravity force is 10 -> no gravity)

  • A force that is going to move forward

  • A max speed to clamp the rigibody's velocity

Example of the closest thing I get with this method (I use trail renderer to render the path):

alt text

I don't want the square look, I think it is because of the max speed value... So I've tested without it and decrease the anti-gravity so it become real gravity and I get a better looking circle:

alt text

The problem here is that the glider need to be really fast and it fall also really fast...

Any idea of how to get something more like what I want???

Cordially.

sans-titre-2.png (31.2 kB)
sans-titre-3.png (34.0 kB)
Comment
Add comment · Show 4
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 Glurth · Feb 08, 2015 at 04:18 PM 0
Share

you can increase the strength of gravity, which should allow it to capture fast moving objects. http://docs.unity3d.com/ScriptReference/Physics-gravity.html

This will still be a balancing act, to fast a glider, and the planet won't be able to capture it, too slow and it will impact before making even a single orbit. Then again, this is just the nature of orbital mechanics.

Hmm, perhaps, if you have only one glider at a time, you could try to base the value of gravity, on the glider's initial speed.

avatar image VSuper · Feb 08, 2015 at 04:43 PM 0
Share

Yeah, I am currently looking for something to do with an adaptative anti-gravity so the gravity at the beginning is normal and it increase with time and with the distance maybe between the glider and the planet... But I have difficulty with this whay that's why I am posting here.

avatar image Glurth · Feb 08, 2015 at 05:09 PM 0
Share

of course, THAT is how orbits work- I missed that in my previous post.

Force Gravity = $$anonymous$$ass1 $$anonymous$$ass2 G / distance^2 (G is the strength of gravity)

You can use this formula, and the AddForce() function (rather than the constant unity gravity), to move your glider. something like this:

glider.AddForce(glider.mass*planet.mass*gravityStrength/ (glider.position-planet.position).Sqr$$anonymous$$agnitude())

avatar image VSuper · Feb 08, 2015 at 05:27 PM 0
Share

ok i'll test that thanks

3 Replies

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

Answer by VSuper · Feb 08, 2015 at 06:33 PM

I find out how to do it, it was really simple:

 rigidbody.MovePosition (rigidbody.position + transform.forward * (Time.deltaTime * wingsuitSpeedFwd));
 rigidbody.AddForce (transform.up * wingsuitGravity);

Instead of moving using force, I use MovePosition, it's also easier to controll the object and it has a perfect movement for my game.

Thanks for your help.

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 Glurth · Feb 08, 2015 at 06:50 PM 0
Share

but you ARE adding force...

avatar image VSuper · Feb 08, 2015 at 07:37 PM 0
Share

Yeah, but only for the gravity, it for cancel the actual gravity.

avatar image
0

Answer by daneislazy · Feb 08, 2015 at 04:40 PM

Are you also having issues with the rotation of the object? I would guess so since that would be something you have to program in manually. But anyways, yea that kind of thing is tricky to do since you are trying to replicate aerodynamic lift and that's complicated as it is, or you're trying to do orbital calculus and that's just silly hard.

If you want the gliding speed/orbit to be pretty constant you can do some Maths to figure out how fast to be going or something. Circumference of a circle is 2pi*r, so maybe get the distance to the planet and do some math and apply some force. (I dunno, just brainstorming)

But that might even be too much work, try turning off the gravity for the glider. Then change the angle of the object to 1-5 degrees off of perpendicular with the planet's surface, then move it locally forward with transform.position += transform.forward * somescalefactor;. That's going completely around the physics, though.

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 VSuper · Feb 08, 2015 at 04:49 PM 0
Share

Ok I see... But I don't have any problem with the rotation of the object, It is always horizontal to the planet's soil. I will try your ways soon I think. Thanks.

avatar image
0

Answer by Soiltest · Apr 14, 2015 at 03:51 PM

Is it accurate to say that you are additionally having issues with the revolution of the item? I would figure so since that would be something you need to program in physically. Be that as it may anyways, yea that sort of thing is precarious to do since you are attempting to imitate flight optimized lift and that is convoluted as it may be, or you're attempting to do orbital analytics and that is just senseless hard.

In the event that you need the skimming velocity/circle to be really steady you can do a few Maths to make sense of how quick to be going or something. Periphery of a circle is 2pi*r, so perhaps get the separation Soil and Plant Nutrients to the planet and do some math and apply some power. (I dunno, simply conceptualizing)

Yet that may even be an excess of work, have a go at killing the gravity for the lightweight plane. At that point change the edge of the item to 1-5 degrees off of opposite with the planet's surface, then accelerate it by regional standards with transform.position += transform.forward * somescalefactor;. That is going totally around the physical science, however.

Comment
Add comment · 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

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

Gravity is preventing object from moving straight toward its direction when calling rigidbody.AddForce... 1 Answer

Tornado throwing back force after pulling 1 Answer

Artificial Gravity 2 Answers

What's the Rigidbody's gravity unit? 1 Answer

Gravitational Object Creation for 3D Game 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