I’m having a bit of trouble here. I’m sure it’s an obvious fix… Basically, I’m trying to change the size, rotation, and position of a game object through iTween, on mouse hover. When the mouse is no longer hovering, I want the object to go back to it’s original size, position, and rotation. Here’s what I have so far…
using UnityEngine;
using System.Collections;
public class TourButton : MonoBehaviour {
void Start() {
iTween.MoveFrom(gameObject, iTween.Hash(“y”, 10, “time”, 5.0));
}
void OnMouseOver() {
//Reason: Mouse-over animation to swing out on hover.
iTween.RotateBy(gameObject, iTween.Hash(“z”, 70, “time”, 0.25));
iTween.MoveFrom(gameObject, iTween.Hash(“y”, 9, “time”, 0.25));
iTween.ScaleBy(gameObject, iTween.Hash(“x”, 2, “time”, 0.25));
}
void OnMouseUp() {
Application.LoadLevel (“YearSelectMenu”);
}
}
Instead of stopping after mouse hover is off the object, the object glitches out and disappears.
Help would be appreciated.