minor fixes

This commit is contained in:
cyndrdev 2021-03-25 19:00:13 +00:00
parent 50955a19d0
commit 6e74da102c
3 changed files with 77 additions and 8 deletions

View File

@ -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}

View File

@ -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}

View File

@ -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;
}
}