Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Yigit Gursoy |
If I create a Line2D node at run-time, it doesn’t work. However, if I create it as a node in a scene, it works. Could this be a bug or am I missing something?
public override void _Input(InputEvent @event)
{
if (@event.IsPressed()
&& @event is InputEventMouseButton eventMouseButton
&& eventMouseButton.ButtonIndex == 1)
{
var trailScene = ResourceLoader.Load<PackedScene>("res://Scenes/Trail.tscn");
var trail = (Line2D)trailScene.Instance();
trail.Points = new Vector2[] { new Vector2(468.958f, 380.869f), new Vector2(309, 209) };
...
...