Skip to content

Commit d6928cf

Browse files
U-Akragas\agrub_000U-Akragas\agrub_000
authored andcommitted
nthoeusnoheun
1 parent a37f1a6 commit d6928cf

File tree

8 files changed

+6
-1
lines changed

8 files changed

+6
-1
lines changed

Assets/Materials/CloudMaterial.mat

132 Bytes
Binary file not shown.
88 Bytes
Binary file not shown.

Assets/Prefabs/CloudPrefab.prefab

64 Bytes
Binary file not shown.

Assets/Prefabs/Walls.prefab

5.55 KB
Binary file not shown.

Assets/Scenes/CloudSandbox.unity

0 Bytes
Binary file not shown.

Assets/Scripts/CloudController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class CloudController : MonoBehaviour
88
public float runThreshold;
99
public float runVelocity;
1010
public float normalVelocity;
11+
public float pullVelocity;
12+
1113

1214
public Material idleMaterial;
1315
public Material rainMaterial;
@@ -54,9 +56,11 @@ void Update()
5456
{
5557
Vector3 deltaPosition = cloudColliderCenter.position - transform.position;
5658
deltaPosition.y = 0.0f;
59+
60+
float deltaMag = deltaPosition.magnitude;
5761
deltaPosition.Normalize();
5862

59-
rigidbody.AddForce(deltaPosition * 10000);
63+
rigidbody.AddForce(deltaPosition * pullVelocity * deltaMag);
6064
renderer.material = rainMaterial;
6165
}
6266
else if (state == CloudState.Dead)

Assets/Scripts/CloudManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void Start()
3333
ctrl.runThreshold = Random.Range(runThresholdLower, runThresholdUpper);
3434
ctrl.runVelocity = Random.Range(runVelocityLower, runVelocityUpper);
3535
ctrl.normalVelocity = Random.Range(normalVelocityLower, normalVelocityUpper);
36+
ctrl.pullVelocity = 100;
3637
}
3738
}
3839

ProjectSettings/TagManager.asset

100644100755
-24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)