- Home /
Question by
Supah_Develepor · May 04, 2015 at 08:17 PM ·
c#cameraanimatorplatformerunity 4
Rotate Camera
Hi. I'm making a platformer and I want the camera to rotate. I'm doing this via animator. For some reason, when I start the scene, it rotates, then goes back to normal and won't rotate again this is what I'm doing
using UnityEngine; using System.Collections;
public class CameraBrain : MonoBehaviour {
public Animator anim;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D (Collider2D collision)
{
if (collision.gameObject.tag == "rotate") {
anim.SetBool ("Rotate", true); }
if (collision.gameObject.tag == "normal_View") {
anim.SetBool ("Rotate", false);}
}
}
Can anybody help please?
Comment
Best Answer
Answer by Waelwindows · May 06, 2015 at 05:44 PM
Even though you figured it out, and for helping other people. You select your animations component and set it to Looping
Your answer
![](https://koobas.hobune.stream/wayback/20220613194737im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
3d platforming Camera 1 Answer
check if there are no object inside a trigger 2 Answers
[ C#] Character Movement based on Camera Direction. 2 Answers
Multiple Cars not working 1 Answer