# \[SOLVED\] Camera shows nothing when switching scenes

**URL:** <https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186>\
**Category:** Help & Support\
**Tags:** graphics, scripting\
**Created:** [March 10, 2024, 9:50pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186 "2024-03-10T21:50:15Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [March 11, 2024, 3:32pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/23 "2024-03-11T15:32:45Z")

</div>

Try adding this to some script (info an update function)

```javascript
if (this.c === undefined) this.c = 0;
this.c++;
pc.Tracing.set(pc.TRACEID_RENDER_FRAME, this.c % 100 === 0);
pc.Tracing.set(pc.TRACEID_RENDER_PASS, this.c % 100 === 0);
pc.Tracing.set(pc.TRACEID_RENDER_PASS_DETAIL, this.c % 100 === 0);

```

It prints every 100th frame what gets rendered. That might give you some info.

In my test, it shows this:

 ![Screenshot 2024-03-11 at 15.34.33](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/f/c/fc6b670fe2c9a2f07621af6e09f25de8f05404db.png)

in 1: RenderPassForward, it renders 6 layers with Camera named Untitled, and also number of meshes submitted.

---

<div class="post-metadata">

**Author:** ![Brent\_Reddick](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/brent_reddick/32/23835_2.png) [@Brent\_Reddick](https://forum.playcanvas.com/u/Brent_Reddick)\
**Post date:** [March 11, 2024, 3:58pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/24 "2024-03-11T15:58:51Z")

</div>

I do not have a camera named untitled, what does this mean?

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [March 11, 2024, 5:01pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/25 "2024-03-11T17:01:44Z")

</div>

This is logging from my project, not your project. I leave that to you 🙂

---

<div class="post-metadata">

**Author:** ![Brent\_Reddick](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/brent_reddick/32/23835_2.png) [@Brent\_Reddick](https://forum.playcanvas.com/u/Brent_Reddick)\
**Post date:** [March 11, 2024, 6:06pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/27 "2024-03-11T18:06:50Z")

</div>

I don’t know, for some reason it does this with specific scenes, this might be engine itz drivin me crazy!

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [March 11, 2024, 6:15pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/28 "2024-03-11T18:15:32Z")

</div>

Can you create a fork that makes the issue easy to reproduce? ie it should take next to no effort to recreate the problem

Do you just launch from Scene 7?

---

<div class="post-metadata">

**Author:** ![Brent\_Reddick](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/brent_reddick/32/23835_2.png) [@Brent\_Reddick](https://forum.playcanvas.com/u/Brent_Reddick)\
**Post date:** [March 11, 2024, 6:19pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/29 "2024-03-11T18:19:44Z")

</div>

yes, it should play an animation then change scenes, it does but you can’t see ANYTHING

---

<div class="post-metadata">

**Author:** ![Brent\_Reddick](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/brent_reddick/32/23835_2.png) [@Brent\_Reddick](https://forum.playcanvas.com/u/Brent_Reddick)\
**Post date:** [March 11, 2024, 6:20pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/30 "2024-03-11T18:20:19Z")

</div>

It is not easy to reproduce, it seems very strange and I have no clue what the problem is

---

<div class="post-metadata">

**Author:** ![Brent\_Reddick](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/brent_reddick/32/23835_2.png) [@Brent\_Reddick](https://forum.playcanvas.com/u/Brent_Reddick)\
**Post date:** [March 11, 2024, 6:32pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/31 "2024-03-11T18:32:29Z")

</div>

I finally solved the issue, I have a limit fps script that would render every so frames, but since the End and Intro scenes did not have one the last updated render was right before the scene switch! Thanks guys for the help! 🙂

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [March 11, 2024, 6:37pm UTC](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186/32 "2024-03-11T18:37:08Z")

</div>

Yep, I just found the issue as well. The easy fix is to change the destroy function to ensure that autoRender is set to true .

```javascript
// initialize code called once per entity
LimitFps.prototype.initialize = function () {

    this.on('destroy', function () {
        clearInterval(this.intervalId);
        this.intervalId = null;
        app.autoRender = true;
    });

```

[Previous page](https://forum.playcanvas.com/t/solved-camera-shows-nothing-when-switching-scenes/35186.md?page=1)
