I keep getting the error message, 'Can't get index "width" on base "Vector2"' from the following code:
func goinitposition():
randomize()
var initposition = Vector2()
initposition.x = getviewportrect().size.width + PIPEWIDTH/2
initposition.y = randrange(0+OFFSETY, getviewportrect().size.height-GROUNDHEIGHT-OFFSETY)
setposition(initposition)
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