Draw_line doesn't draw line

Godot Version

4.2.2 stable official

Question

I want to draw line from bullet_lines[0][0] to bullet_lines[0][1]


but there is no line on screen
This is bullet_lines
b

  • Did you call it’s queue_redraw method?
  • Is your node out of viewport bounds?
  • Is the line is so far from drawer node?

Position arguments in draw methods is relative position about the node.

1 Like

1.yes
2.it is root node at 0, 0
3.screen size is 1920 x 1080

  • What is display/window/size/viewport_width and display/window/size/viewport_height?
  • What output is print(get_viewport_rect())?

I guess it’s out of viewport so it can’t be seen.

  • Which type is the root node?
  • Is there any print statement that printed that you seen in other lines?
  • Is that node visible?
  • Did other node cover it with same color? Like SubViewportContainer.

Also i can’t reproduce it by following code:

extends Node2D

func _draw() -> void:
    draw_line(Vector2(954.0582, 346.0456), Vector2(832, 64), Color.WHITE, 100)