Godot Version
Question
this is the nodes layout
and this is the code
sorry I forgot to remove the comment tags.
the version is godot 4.2.2
and I’m trying to replicate shellshock live aiming system but the line2d doesn’t start at marker2d and doesn’t seem to move unlike the sprite.
use $Marker2D.global_position
and if this is still offset use this:
to_local($Marker2D.global_position)
still no luck
Sorry should have been more concrete:
Line.set_point_position(0, to_local($Marker2D.global_position))
Line.set_point_position(1, to_local(mouse))
now it no longer follows the mouse and instead goes in a straight line across the screen
Omg made an error again, sorry:
Line.set_point_position(0, Line.to_local($Marker2D.global_position))
Line.set_point_position(1, Line.to_local(mouse))
it has to be local to the Line
it worked!!! thank you so much
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.