Im trying to make dynamic snow but i cant get the sprite to follow the player?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Chickentendie007

I am trying to get the sprite that makes the snow fall but I don’t know how to set the position of the sprite to the kinimaticbodys position without it being an error?

You should be more specific. What error are you getting? Does the snow fall but in the incorrect position? Does the snow not fall at all?

godot_dev_ | 2023-04-28 14:20

The code i have is :$Viewport/Sprite.position = Vector2($ball.translation.x, $ball.translation.z)

And yes the snow falls in but however, but it does not follow the player and it stays in one spot. But when i print the position it follows the ball but the snow does not go down

Errors:
E 0:00:00.578 get_node: (Node not found: “Viewport” (relative to “Spatial”).)
<C++ Error> Method failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1477 @ get_node()
E 0:00:00.578 setup_local_to_scene: ViewportTexture: Path to node is invalid.
<C++ Error> Condition “!vpn” is true.
<C++ Source> scene/main/viewport.cpp:70 @ setup_local_to_scene()

Chickentendie007 | 2023-04-28 14:31

It looks like the path to your sprite is incorrect, so the position of the sprite is never being set.

TRAILtheGREAT | 2023-04-28 20:50