Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate Node transform/How to create Node Animations #534

Open
ThomasGorisse opened this issue Jun 25, 2024 Discussed in #482 · 0 comments
Open

Animate Node transform/How to create Node Animations #534

ThomasGorisse opened this issue Jun 25, 2024 Discussed in #482 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ThomasGorisse
Copy link
Contributor

Discussed in #482

Originally posted by paricleu April 4, 2024
I've ran into a problem animating Node transforms.
Transforms without animations work well e.g. node.transform(position, rotation, scale) and even smooth transformation are fine e.g.

node.transform(position, rotation, scale, true, 1.0)

Even tho it is nowhere documented what the "smoothSpeed" is referencing to. Is is seconds? It does not seem to be.

What I am trying to achieve is animating a node and also be able to stop the animation if it is not finished yet.
I came across

    fun animatePositions(vararg positions: Position): ObjectAnimator =
        NodeAnimator.ofPosition(this, *positions)

    fun animateQuaternions(vararg quaternions: Quaternion): ObjectAnimator =
        NodeAnimator.ofQuaternion(this, *quaternions)

    fun animateRotations(vararg rotations: Rotation): ObjectAnimator =
        NodeAnimator.ofRotation(this, *rotations)

    fun animateScales(vararg scales: Scale): ObjectAnimator =
        NodeAnimator.ofScale(this, *scales)

    fun animateTransforms(vararg transforms: Transform): AnimatorSet =
        NodeAnimator.ofTransform(this, *transforms)

in Node.kt but I have no clue how to use it.
node.animateRotations(rotation).start() does nothing.

How can I create a node animation so it is cancelable?

@ThomasGorisse ThomasGorisse added the bug Something isn't working label Jun 25, 2024
@ThomasGorisse ThomasGorisse self-assigned this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant