File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ Prefab:
193
193
propertyPath : m_RootOrder
194
194
value : 1
195
195
objectReference : {fileID: 0}
196
+ - target : {fileID: 54398052497140864, guid: 30da5df0ee3ec8247ac02c74ea8e0a34,
197
+ type : 2}
198
+ propertyPath : m_Constraints
199
+ value : 8
200
+ objectReference : {fileID: 0}
196
201
m_RemovedComponents : []
197
202
m_ParentPrefab : {fileID: 100100000, guid: 30da5df0ee3ec8247ac02c74ea8e0a34, type: 2}
198
203
m_IsPrefabParent : 0
Original file line number Diff line number Diff line change @@ -341,9 +341,9 @@ Rigidbody:
341
341
m_PrefabInternal : {fileID: 100100000}
342
342
m_GameObject : {fileID: 1839490939624924}
343
343
serializedVersion : 2
344
- m_Mass : 0.12
345
- m_Drag : 0.25
346
- m_AngularDrag : 0.06
344
+ m_Mass : 1
345
+ m_Drag : 0.2
346
+ m_AngularDrag : 0.05
347
347
m_UseGravity : 1
348
348
m_IsKinematic : 0
349
349
m_Interpolate : 0
@@ -488,3 +488,5 @@ MonoBehaviour:
488
488
m_Script : {fileID: 11500000, guid: 74e47f00f5249b64b8cb52acb8272110, type: 3}
489
489
m_Name :
490
490
m_EditorClassIdentifier :
491
+ rcsThrust : 250
492
+ mainThrust : 50
Original file line number Diff line number Diff line change 5
5
6
6
public class Rocket : MonoBehaviour {
7
7
8
+ [ SerializeField ] [ Range ( 1.0f , 1000f ) ] float rcsThrust = 1 ;
9
+ [ SerializeField ] [ Range ( 1.0f , 1000f ) ] float mainThrust = 1 ;
10
+
8
11
Rigidbody rigidbody ;
9
12
AudioSource audioSource ;
10
13
@@ -26,7 +29,7 @@ private void Thrust()
26
29
{
27
30
if ( Input . GetKey ( KeyCode . Space ) )
28
31
{
29
- rigidbody . AddRelativeForce ( Vector3 . up ) ;
32
+ rigidbody . AddRelativeForce ( Vector3 . up * Time . deltaTime * mainThrust ) ;
30
33
if ( ! audioSource . isPlaying )
31
34
{
32
35
audioSource . Play ( ) ;
@@ -44,11 +47,11 @@ private void Rotate()
44
47
rigidbody . freezeRotation = true ; // Take manual control of the rotation
45
48
if ( Input . GetKey ( KeyCode . A ) && ! Input . GetKey ( KeyCode . D ) )
46
49
{
47
- transform . Rotate ( new Vector3 ( 0 , 0 , 50 ) * Time . deltaTime ) ;
50
+ transform . Rotate ( Vector3 . forward * Time . deltaTime * rcsThrust ) ;
48
51
}
49
52
if ( Input . GetKey ( KeyCode . D ) && ! Input . GetKey ( KeyCode . A ) )
50
53
{
51
- transform . Rotate ( new Vector3 ( 0 , 0 , - 50 ) * Time . deltaTime ) ;
54
+ transform . Rotate ( - Vector3 . forward * Time . deltaTime * rcsThrust ) ;
52
55
}
53
56
rigidbody . freezeRotation = false ; // Resume Physics Control of rotation
54
57
}
You can’t perform that action at this time.
0 commit comments