diff --git a/game/Assets/Prefabs/Traps/RollingBoulder.prefab b/game/Assets/Prefabs/Traps/RollingBoulder.prefab index 6c3b059..fa12fb1 100644 --- a/game/Assets/Prefabs/Traps/RollingBoulder.prefab +++ b/game/Assets/Prefabs/Traps/RollingBoulder.prefab @@ -27,7 +27,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1157356545022895102} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 5.47, y: -0.91722655, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 6536764240838670284} @@ -48,7 +48,7 @@ MeshRenderer: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1157356545022895102} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 @@ -155,7 +155,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6536764241329740421} m_LocalRotation: {x: -0, y: -0, z: -0.2118744, w: 0.97729695} - m_LocalPosition: {x: 14.21, y: 1.29, z: 1.3218994} + m_LocalPosition: {x: 0, y: 1.29, z: 0} m_LocalScale: {x: 1, y: 1, z: 0.29492} m_Children: [] m_Father: {fileID: 6536764240838670284} @@ -255,7 +255,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6536764242362416381} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 10.92, y: 4.15, z: 1.271904} + m_LocalPosition: {x: -2.5, y: 3.5827737, z: 0} m_LocalScale: {x: 2.1579, y: 2.1579, z: 2.1579} m_Children: [] m_Father: {fileID: 6536764240838670284} diff --git a/game/Assets/Scenes/Main.unity b/game/Assets/Scenes/Main.unity index cfd5b10..dd8883e 100644 --- a/game/Assets/Scenes/Main.unity +++ b/game/Assets/Scenes/Main.unity @@ -4624,6 +4624,68 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674077961207736} m_PrefabAsset: {fileID: 0} +--- !u!1001 &1462391825 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1571618361} + m_Modifications: + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalPosition.x + value: -40 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalPosition.y + value: 0.91722655 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalPosition.z + value: 83.5 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6536764240838670287, guid: baf177258b70ed448964e62915be41ee, type: 3} + propertyPath: m_Name + value: RollingBoulder + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: baf177258b70ed448964e62915be41ee, type: 3} +--- !u!4 &1462391826 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6536764240838670284, guid: baf177258b70ed448964e62915be41ee, type: 3} + m_PrefabInstance: {fileID: 1462391825} + m_PrefabAsset: {fileID: 0} --- !u!4 &1464700863 stripped Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 584f9522dd055c543863c0c60d13776e, type: 3} @@ -5056,6 +5118,7 @@ Transform: m_Children: - {fileID: 300150933} - {fileID: 1511725763} + - {fileID: 1462391826} m_Father: {fileID: 0} m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/game/Assets/Scripts/Traps/Mover.cs b/game/Assets/Scripts/Traps/Mover.cs index b3c2d30..39c930a 100644 --- a/game/Assets/Scripts/Traps/Mover.cs +++ b/game/Assets/Scripts/Traps/Mover.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -7,12 +8,17 @@ public class Mover : MonoBehaviour [SerializeField] private float speed; [SerializeField] private GameObject target; + private void OnEnable() + { + float dt = Time.fixedDeltaTime; + Quaternion targetRotation = Quaternion.LookRotation(target.transform.position - transform.position); + transform.rotation = targetRotation; + } + // Update is called once per frame void FixedUpdate() { - //transform.LookAt(player.transform); - Quaternion targetRotation = Quaternion.LookRotation(target.transform.position - transform.position); - transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, 1 * Time.deltaTime); - transform.position += transform.forward * speed * Time.deltaTime; + float dt = Time.fixedDeltaTime; + transform.position += transform.forward * speed * dt; } }