Sceneform-android-sdk: [Question] Is there a way to do scale animation on Objects?

Created on 3 May 2019  路  1Comment  路  Source: google-ar/sceneform-android-sdk

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?

question

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peronecode picture peronecode  路  3Comments

yashvv picture yashvv  路  3Comments

scolar picture scolar  路  4Comments

khonakr picture khonakr  路  3Comments

LukasStancikas picture LukasStancikas  路  3Comments