- Home /
How can i make the spaceship to land/take off with physics vertical ?
What i did so far.
In the Hierarchy i created a new cube changed it's scale and called it Base. In the Hierarchy i also have a Spaceship object with a Rigidbody component.
Then i created a new Physic Material and changed the Bounciness value to 1. The Physic Material i dragged over on the Base.
The spaceship position is above the Base.
When i'm running the game the spaceship is moving down slowly and then fall down through the terrain. I want it to land vertical on the base. Once it's landed wait 2-3 seconds and take off vertical to the same height position it landed from.
But the question/s is if i did it right by using Physic Material and why it's falling through the terrain ? I didn't create yet any script for it(C#).
I want the land and the take off to be automatic i don't want to control on my own the spaceship for now.
A screenshot of the Spaceship and the base on the right the Spaceship Inspector:
And the second screenshot the base and it's inspector on the right:
Answer by FlaSh-G · Jun 20, 2017 at 04:41 PM
A Rigidbody only adds the GameObject to the physics engine - it does not give your object a physical shape. In addition to the Rigidbody, you need to also give at least one Collider to your ship or one of its children objects (!) in order to define its shape.
Which makes sense - you would not want the Rigidbody component to just assume the ship's shape, you want to have control of it instead.
Right. With a box collider component on the ship it's now not falling through the terrain. But still it's not a real vertical landing i think. It's more like a bouncing ball.
First the space ship is moving down and then in the end falling like a bouncing ball. Second in the end half of the ship is inside the base and not on the base(cube).
How can i make it more realistic landing ? Or it should be bouncing like that ?
Of course it's bouncing, you set the bouncyness to 1! :D
Answer by · Jun 20, 2017 at 06:04 PM
Please, take a look at the physics tutorials. https://unity3d.com/pt/learn/tutorials/topics/physics They are not long and a lot of your questions will be answered there.
Your answer
Follow this Question
Related Questions
How can i rotate the camera with the mouse but only when drag ? 0 Answers
Why when changing the doors colors it's not changing anything ? 1 Answer
When i Instantiate new objects what should i do with the original object ? 1 Answer
How to make Rigidbody.AddForce less delayed in Unity3D? 0 Answers
How can i List objects by name but also in small text or big text or any kind ? 1 Answer