Skip to content

Commit 2f5a6d5

Browse files
committed
Physics and Rigibodies
1 parent 1f491bc commit 2f5a6d5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Assets/Level 1.unity

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,15 @@ Prefab:
289289
m_Modifications:
290290
- target: {fileID: 4429351561463374, guid: 30da5df0ee3ec8247ac02c74ea8e0a34, type: 2}
291291
propertyPath: m_LocalPosition.x
292-
value: -0.09134564
292+
value: 0
293293
objectReference: {fileID: 0}
294294
- target: {fileID: 4429351561463374, guid: 30da5df0ee3ec8247ac02c74ea8e0a34, type: 2}
295295
propertyPath: m_LocalPosition.y
296-
value: 1.0009999
296+
value: 1.66
297297
objectReference: {fileID: 0}
298298
- target: {fileID: 4429351561463374, guid: 30da5df0ee3ec8247ac02c74ea8e0a34, type: 2}
299299
propertyPath: m_LocalPosition.z
300-
value: -0.25569773
300+
value: 0
301301
objectReference: {fileID: 0}
302302
- target: {fileID: 4429351561463374, guid: 30da5df0ee3ec8247ac02c74ea8e0a34, type: 2}
303303
propertyPath: m_LocalRotation.x
@@ -334,7 +334,7 @@ Rigidbody:
334334
m_PrefabInternal: {fileID: 0}
335335
m_GameObject: {fileID: 1909277555}
336336
serializedVersion: 2
337-
m_Mass: 1
337+
m_Mass: 0.2
338338
m_Drag: 0
339339
m_AngularDrag: 0.05
340340
m_UseGravity: 1

Assets/Rocket.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
using UnityEngine;
55

66
public class Rocket : MonoBehaviour {
7-
7+
8+
Rigidbody rigidbody;
9+
810
// Use this for initialization
911
void Start ()
1012
{
11-
13+
rigidbody = GetComponent<Rigidbody>();
1214
}
1315

1416
// Update is called once per frame
@@ -21,7 +23,7 @@ private void ProcessInput()
2123
{
2224
if(Input.GetKey(KeyCode.Space))
2325
{
24-
print("Thrusting");
26+
rigidbody.AddRelativeForce(Vector3.up);
2527
}
2628
if(Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.D))
2729
{

0 commit comments

Comments
 (0)