-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLollie_Movement.cs
51 lines (33 loc) · 1001 Bytes
/
Lollie_Movement.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Lollie_Movement : MonoBehaviour
{
//max rotation (simulate momentum)
public float leftMax = 80;
public float rightMax = -40;
public float swingSpeed = 6.0f;
// Use this for initialization
void Start () {
//min=transform.position.x;
//max=transform.position.x+4;
}
// Update is called once per frame
void Update ()
{
transform.Rotate(new Vector3(15, 0, 0) * Time.deltaTime * swingSpeed);
if (transform.rotation.x == leftMax)
{
Debug.Log("Hit Critical Max");
}
//if (transform.rotation.x < leftMax)
//{
// swingSpeed = -6.0f;
// Debug.Log("Going Left");
//}
//if (transform.rotation.x < rightMax)
//{
// swingSpeed = 6.0f;
//}
}
}