Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Macryc |
Hi
I want to do get_viewport().get_camera()
in godot 4 but it tells me there is no get_viewport()
any more… I should probably use get_camera3d()
or some such but I need to solve the viewport problem first. Can anyone help?
it tells me there is no
get_viewport()
any more
Are you sure about this? It’s still a public method in Node on the master branch: https://github.com/godotengine/godot/blob/master/scene/main/node.h#L460
Maybe post a screenshot of the error in the editor?
Bernard Cloutier | 2021-12-17 15:11
I downloaded the latest 4.0 build and there doesn’t seem to be a problem:
Are you sure your script is on a Node and not a Resource or something else?
Bernard Cloutier | 2021-12-17 15:17
It just says ‘no function “get_viewport()” in base self’.
Macryc | 2021-12-17 15:24
https://i.ibb.co/mRdJjwS/Screenshot-2021-12-17-163224.png
Macryc | 2021-12-17 15:33
What type of node is your script attached to? Please show the top of the script including the extends blahblah
Bernard Cloutier | 2021-12-17 20:26