fixed bug by @Tucan444
This commit is contained in:
@@ -21,15 +21,13 @@ public class RotateAroundSelfAxis : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
rotation = transform.rotation;
|
||||
|
||||
|
||||
if(right_rotation) {
|
||||
rotation[2] -= speed * Time.deltaTime;
|
||||
transform.localRotation *= Quaternion.AngleAxis(speed * Time.deltaTime, new Vector3(0f, 0f, -1f));
|
||||
} else {
|
||||
rotation[2] += speed * Time.deltaTime;
|
||||
transform.localRotation *= Quaternion.AngleAxis(speed * Time.deltaTime, new Vector3(0f, 0f, 1f));
|
||||
}
|
||||
Debug.Log(speed * Time.deltaTime);
|
||||
|
||||
transform.rotation = rotation;
|
||||
|
||||
Debug.Log(rotation[2]);
|
||||
}
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@ public class Rotation : MonoBehaviour
|
||||
public bool static_center = true;
|
||||
public bool right_rotation = true;
|
||||
public bool flipping = false;
|
||||
[Range(0.1f, 8)] [SerializeField] private float speed = 1;
|
||||
[Range(0, (float)Math.PI * 2)] [SerializeField] private float flip_angle = 0;
|
||||
[Range(0.1f, 8)] public float speed = 1;
|
||||
[Range(0, (float)Math.PI * 2)] public float flip_angle = 0;
|
||||
|
||||
private float angle;
|
||||
private float magnitude;
|
||||
|
Reference in New Issue
Block a user