my computer get freeze with itween
hi everybody, im doing a simulator, for that reason i don't need a player and i don't need a script to move that player... actually im doing a script that move a camera with UI buttons and im using itween to move the camera. in the "game" im using another script that move the floor this to leave you in context and nothing elsse... this is the code that i using to make the camera move...
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class movimientoCamara : MonoBehaviour {
public Button camara1;
public Button camara2;
private GameObject camara;
// Use this for initialization
void Start () {
camara = GameObject.FindGameObjectWithTag ("MainCamera");
camara1.interactable = false;
camara2.interactable = true;
}
// Update is called once per frame
void Update () {
camara1.onClick.AddListener (() => mueveCamara1());
camara2.onClick.AddListener (() => mueveCamara2());
}
void mueveCamara1()
{
iTween.MoveTo(camara, iTween.Hash("x", 14, "time", 3));
iTween.RotateTo(camara, iTween.Hash("y",222,"time",3));
camara1.interactable = false;
camara2.interactable = true;
}
void mueveCamara2()
{
iTween.MoveTo(camara, iTween.Hash("x", -8, "time", 3));
iTween.RotateTo(camara, iTween.Hash("y",130,"time",3));
camara1.interactable = true;
camara2.interactable = false;
}
}
the problem came when i execute the "game" and after 2 or 3 times that i switch the camera the game get freeze and i dont know why. when i remove the rotation the "game" does not get freeze inmedialty sometimes get freeze and sometimes does not get freeze. i would like to use itween because his effect is all i need for my simulator...
thank you so much, and so sorry for my english
Your answer
Follow this Question
Related Questions
After opening or creating project , unity editor window won't show up 0 Answers
[HELP URGENT] Resolving dependencies. 0 Answers
unity 3d freeze 0 Answers
Unity freezes after editing code (Visual Studio) 0 Answers
Unity Freezing 1 Answer