Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnTriggerStay(Collider col){
- if (col.tag == "Right Gate") {
- Debug.Log ("Pasok");
- float currentRotationY = this.gameObject.transform.localRotation.y;
- float goalRotation = 90f;
- Quaternion target = Quaternion.Euler (0, goalRotation, 0);
- this.gameObject.transform.localRotation = Quaternion.Slerp (this.gameObject.transform.localRotation, target, Time.deltaTime * 3f);
- } else if (col.tag == "Left Gate") {
- Debug.Log ("Pasok");
- float currentRotationY = this.gameObject.transform.localRotation.y;
- float goalRotation = -90.0f;
- Quaternion target = Quaternion.Euler (new Vector3(0, goalRotation, 0));
- this.gameObject.transform.localRotation = Quaternion.Slerp(this.gameObject.transform.localRotation, target, Time.deltaTime * 2f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement