Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ERJstrife |
I keep getting the error message, ‘Can’t get index “width” on base “Vector2”’ from the following code:
func go_init_position():
randomize()
var init_position = Vector2()
init_position.x = get_viewport_rect().size.width + PIPE_WIDTH/2
init_position.y = rand_range(0+OFFSET_Y, get_viewport_rect().size.height-GROUND_HEIGHT-OFFSET_Y)
set_position(init_position)
pass
Is there something I am missing or another way to code this?
additional information:
I’ve been following a four year old Flappy Bird tutorial and so far there have been issues changing some code to function in 3.2, so this might be a similar case. The link to the video is here Flappy Bird Godot Engine Tutorial and the code is implemented at the time 35:39