Skip to content

C#: Tween.TweenProperty()'s NodePath parameter is not compatible with PropertyName #82219

@kennypu

Description

@kennypu

Godot version

4.2.dev5.mono.official

System information

Godot v4.2.dev5.mono - Windows 10.0.22621 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.3699) - 12th Gen Intel(R) Core(TM) i5-12600K (16 Threads)

Issue description

I believe this is more of an issue with NodePath vs StringName, but when providing a PropertyName to Tween.TweenProperty() you will get an error: cannot convert form 'Godot.StringName' to 'Godot.NodePath'.

The workaround is of course simple: Just append .ToString().

However, In various locations in the documentation where property_name is needed, it is recommended to use PropertyName . I would think the expectation would be that the above line should work without issue, and without having to convert PropertyName.SomeName to a string. This recommendation is also used in the documentation of get_indexed(), in which case if a developer were to follow the directions in the documentation, they will find that just using PropertyName will result in an error.

Steps to reproduce

Minimal Example

// This should be expected to work, but will produce an error
CreateTween().TweenProperty(this, Node2D.PropertyName.Position, Vector2.Zero, 1.0f);

// Adding .ToString() to the property_name is needed
CreateTween().TweenProperty(this, Node2D.PropertyName.Position.ToString(), Vector2.Zero, 1.0f);

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions