So I’ve set up some 2 scripts. In one script it will control whether the Glove Pointer (GameObject) is active or inactive using the SetActive() method. In another script I will call logic in the OnEnable and OnDisable functions: Here is the script for this:
private void Start() {
startPosition = gameObject.GetComponent<RectTransform>().position;
ToPosition = startPosition.x - 0.1f;
}
void OnEnable() {
LeanTween.moveX(gameObject,ToPosition, 0.6f).setLoopPingPong().setIgnoreTimeScale(true);
}
private void OnDisable() {
LeanTween.reset();
gameObject.GetComponent<RectTransform>().position = startPosition;
}
In the video below, you’ll see that even though one of the Glove Pointers is now active (it shows in the hierarchy as active and it’s checked to say it’s active) I need to manually check it again in order for the OnEnable code to execute. This doesn’t appear to be the case with each Glove Pointer though, as some will fire the transition, but other’s won’t even though it’s now active in the hierarchy. My question is then, how do I get each Glove Pointer to play the tween animation?
emptyserpentinecirriped