I'm trying to do scale animation on a node. For example I am using the following for move animation in the scene
private ObjectAnimator createAnimator(Vector3 startPosition, Vector3 endPosition) {
ObjectAnimator animator = new ObjectAnimator();
animator.setObjectValues(startPosition, endPosition);
animator.setPropertyName("localPosition");
animator.setEvaluator(new Vector3Evaluator());
animator.setInterpolator(new LinearInterpolator());
animator.setAutoCancel(true);
animator.setTarget(this);
animator.setDuration(750);
return animator;
}
Is there a way to give initial scale and desired endScale that we can set to an object?
You should be able to animate the scale using the same method you described, but rather than using the "localPosition" property, use the "localScale" property. This will cause the LocalScale of the target Node to be animated rather than the local position.
Most helpful comment
You should be able to animate the scale using the same method you described, but rather than using the
"localPosition"property, use the"localScale"property. This will cause the LocalScale of the target Node to be animated rather than the local position.