Skip to content

RenderTexture error #1097

Closed Answered by rh101
10100010010001001010 asked this question in Q&A
Discussion options

You must be logged in to vote

If you check the location of that crash via a debugger, you would see that the crash is from this assert:

It is pointing out exactly what the problem is.

Also, given that you haven't provided any context to your code snippet, we cannot tell where and when you're calling that code. My guess is that you're using it in the init() method, which is not the right place for it. The scene would not have finished initializing at that point.

The way to fix it is to ensure that you do not call that code until after the scene has finished initializing, and there are many ways to handle this.

For example, you can still use it in init(), but you need to schedule it for the next cycle using scheduleOnce,…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 10100010010001001010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants