tween with meshinstance

fonofono Posts: 45Member
edited January 4 in 3D

Hi all,

i've a spatial with a meshinstance.

I'm trying to tween interpolate the z translation without success:

func _on_Timer_timeout():
    mytween2.interpolate_property($MeshInstance,"translation",translation.z,translation.z-1,1,1,0)
    mytween2.start()

This code is in a timer that get executed. If I executed the following code it work, but without tween

if $MeshInstance.translation.z < - 5:
    $MeshInstance.translation.z=-1
$MeshInstance.translation.z=$MeshInstance.translation.z-1

What i'm doing wrong? I would like to have the tween working.
I got no error as well.

Thanks

Comments

  • fonofono Posts: 45Member

    ok, i've to use a vector 3. All clear.

  • cyberealitycybereality Posts: 1,086Moderator

    I haven't used tweens yet, but thanks for following up with the solution.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file