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

SceneTreeTween not work properly when tween one axis with from() #100366

Open
yikescloud opened this issue Dec 13, 2024 · 1 comment
Open

SceneTreeTween not work properly when tween one axis with from() #100366

yikescloud opened this issue Dec 13, 2024 · 1 comment

Comments

@yikescloud
Copy link

Tested versions

Reproduce in Godot 3.5.3( Issue not exist in 4.x)

System information

Windows10 Pro

Issue description

When tween "One Axis" with SceneTreeTween with tween_property(self, "position:x").from(), tween looks different and clunky from tween both axis, or without from().

Steps to reproduce

Create a normal sprite and attach the script:TweenAxis.zip

if _Tween: _Tween.kill() _Tween = create_tween() _Tween.set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK) _Tween.tween_property($Sprite, "position:x", 300, 0.3).from(0) _Tween.play()

Minimal reproduction project (MRP)

TweenAxis.zip

@kleonc
Copy link
Member

kleonc commented Dec 13, 2024

Reproducible in:

This is a duplicate of #74102, the tweened property is a float but the value passed to from is an int. MRP produces this error:

E 0:00:01.942   calculate_delta_value: Type mismatch between initial and final value: int and float
  <C++ Error>   Condition "p_intial_val.get_type() != p_final_val.get_type()" is true. Returned: p_intial_val
  <C++ Source>  scene/animation/scene_tree_tween.cpp:513 @ calculate_delta_value()

Changing .from(160) to .from(160.0) in the MRP solves the issue.

The fix (#74112) needs to be cherry-picked/backported to 3.x.

@kleonc kleonc added this to the 3.x milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants