0 votes

I am trying to create portals in my 2d game, and I want each portal to show a view of where the portal leads to. Each portal has a Polygon2D shape that I want to texture with the view into the other place in the world. I assume the way to do the is to set the texture to "New ViewportTexture", so I added a viewport with a camera to my Portal scene. The problem is, the viewport will be inside of the world I am trying to render it to, and it seems like this is a problem. Also, I saved Portal as a separate scene so that I can create instances of it whenever the character in my game creates a new portal. This means that the viewport isn't even in the world that the viewport needs to render to until an instance of Portal is created in the world. So I'm guessing I need to write code to set the target world of the viewport every time an instance of Portal is created, but I don't know how to do this. Any help is appreciated!

in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories