From 2de1111cd0d40c6c867b7315b10ffeb6e978cb91 Mon Sep 17 00:00:00 2001 From: nothke Date: Sun, 18 Aug 2024 16:19:17 +0200 Subject: [PATCH] Swingin' magnet --- Assets/Prefabs/sliding_crane.prefab | 10 ++++------ Assets/Scripts/SlidingCrane.cs | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/sliding_crane.prefab b/Assets/Prefabs/sliding_crane.prefab index 7afa354..0076237 100644 --- a/Assets/Prefabs/sliding_crane.prefab +++ b/Assets/Prefabs/sliding_crane.prefab @@ -177,6 +177,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 3986187515445640859} + - {fileID: 7611546785051987167} - {fileID: 5222629025906584878} - {fileID: 1852272770860807465} - {fileID: 328029784031995857} @@ -671,7 +672,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 5974025308748047927} + m_TransformParent: {fileID: 8361960510235702639} m_Modifications: - target: {fileID: 1459697740546535004, guid: 146ff579bcab1a343bdcbf24e8b5e462, type: 3} propertyPath: m_Name @@ -683,11 +684,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5436501012833944904, guid: 146ff579bcab1a343bdcbf24e8b5e462, type: 3} propertyPath: m_LocalPosition.y - value: -10 + value: 3.0155554 objectReference: {fileID: 0} - target: {fileID: 5436501012833944904, guid: 146ff579bcab1a343bdcbf24e8b5e462, type: 3} propertyPath: m_LocalPosition.z - value: 0 + value: 0.008621216 objectReference: {fileID: 0} - target: {fileID: 5436501012833944904, guid: 146ff579bcab1a343bdcbf24e8b5e462, type: 3} propertyPath: m_LocalRotation.w @@ -1216,9 +1217,6 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 353720696122903966, guid: 6de450877d355da4ea6654f6ce89c7ae, type: 3} insertIndex: -1 addedObject: {fileID: 6812918532662551388} - - targetCorrespondingSourceObject: {fileID: 353720696122903966, guid: 6de450877d355da4ea6654f6ce89c7ae, type: 3} - insertIndex: -1 - addedObject: {fileID: 7611546785051987167} - targetCorrespondingSourceObject: {fileID: 353720696122903966, guid: 6de450877d355da4ea6654f6ce89c7ae, type: 3} insertIndex: -1 addedObject: {fileID: 2128323862978452036} diff --git a/Assets/Scripts/SlidingCrane.cs b/Assets/Scripts/SlidingCrane.cs index 62d7c67..1c91185 100644 --- a/Assets/Scripts/SlidingCrane.cs +++ b/Assets/Scripts/SlidingCrane.cs @@ -24,6 +24,7 @@ public class SlidingCrane : MonoBehaviour private void Start() { target = transform.position; + xMotion.progress = 0.5f; } void FixedUpdate() @@ -51,6 +52,6 @@ public class SlidingCrane : MonoBehaviour yTransform.localPosition = new Vector3(0, 0, yMotion.progress * yRange); xTransform.localPosition = new Vector3(x, 0, 0); - cradleRb.MovePosition(cradleTransform.position); + //cradleRb.MovePosition(cradleTransform.position); } }