rolling boulders now obey to freeze

This commit is contained in:
Novvator 2021-04-06 15:29:41 +01:00
parent fffb50a6a2
commit 0e96d83445
2 changed files with 4 additions and 1 deletions

View File

@ -379,3 +379,4 @@ MonoBehaviour:
m_EditorClassIdentifier:
speed: 2
target: {fileID: 1157356545022895102}
objectTimeScale: {fileID: 11400000, guid: 9b68e167db44c0c42837e9a679da964e, type: 2}

View File

@ -1,3 +1,4 @@
using Ktyl.Util;
using System;
using System.Collections;
using System.Collections.Generic;
@ -7,6 +8,7 @@ public class Mover : MonoBehaviour
{
[SerializeField] private float speed;
[SerializeField] private GameObject target;
[SerializeField] private SerialFloat objectTimeScale;
private void OnEnable()
{
@ -19,6 +21,6 @@ public class Mover : MonoBehaviour
void FixedUpdate()
{
float dt = Time.fixedDeltaTime;
transform.position += transform.forward * speed * dt;
transform.position += transform.forward * speed * dt * objectTimeScale;
}
}