diff --git a/Game/Assets/Scenes/cems scene.unity b/Game/Assets/Scenes/cems scene.unity index fa92e0c..d116a7b 100644 --- a/Game/Assets/Scenes/cems scene.unity +++ b/Game/Assets/Scenes/cems scene.unity @@ -133,15 +133,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3} propertyPath: m_LocalScale.y - value: 0.47118455 + value: 0.58290243 objectReference: {fileID: 0} - target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3} propertyPath: m_LocalPosition.x - value: -5.7978 + value: -4.73 objectReference: {fileID: 0} - target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3} propertyPath: m_LocalPosition.y - value: 0.9887 + value: -2.3359 objectReference: {fileID: 0} - target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3} propertyPath: m_LocalPosition.z @@ -385,7 +385,7 @@ Rigidbody2D: m_Mass: 1 m_LinearDamping: 0 m_AngularDamping: 0.05 - m_GravityScale: 1 + m_GravityScale: 0 m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -455,6 +455,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 64d83d81ffe9aeb419af4eb171357948, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::DropletMovement + moveSpeed: 5 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Game/Assets/Scripts/DropletMovement.cs b/Game/Assets/Scripts/DropletMovement.cs index 43f3ebc..76b61a6 100644 --- a/Game/Assets/Scripts/DropletMovement.cs +++ b/Game/Assets/Scripts/DropletMovement.cs @@ -2,15 +2,27 @@ using UnityEngine; public class DropletMovement : MonoBehaviour { + + public float moveSpeed = 5f; + + private Rigidbody2D rb; + private Vector2 movement; + // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { - + rb = GetComponent(); } // Update is called once per frame void Update() { - + movement.x = Input.GetAxisRaw("Horizontal"); + movement.y = Input.GetAxisRaw("Vertical"); + } + + private void FixedUpdate() + { + rb.linearVelocity = movement.normalized * moveSpeed; } }