[SOLVED] Post processing

We are trying to add an effect on our credits scene.
We downloaded the script, added to our assets and attached the script to the camera in our scene. However we are getting this error.
[playcanvas-1.60.0.dbg.js:8935]: Cannot read properties of undefined (reading ‘indexOf’)

What may be causing this?
Link to editor: https://playcanvas.com/editor/scene/1609368

Hmm I’m not sure what’s going on here. Looks like this post process effect has been written against engine v1.61 (the current engine version is v1.60).

If you run the launch page and specify engine v1.61 (which btw should be released tomorrow), it seems to work. Try it like so.

Where did you get this post process script?

@mvaligursky might have more context here.

Thanks

I got the post process script here

Ahh ok that makes sense then! :slight_smile: Github main branch is the bleeding edge, which is currently roughly engine v1.61.

For v1.60 you would have to use engine/posteffect-huesaturation.js at release-1.60 · playcanvas/engine · GitHub instead.

However, as I mentioned before we should be updating the editor to engine v1.61 tomorrow and so what you have now will work.

Thanks!

@Ashley_Solano I am not sure if this is the issue or not but I see that this script is in the camera entity. @slimbuck may have better insight into this. Also, looking at the menu script I see.

var MenuScene = pc.createScript('menuScene');

// initialize code called once per entity
MenuScene.prototype.initialize = function() {

};

// update code called every frame
MenuScene.prototype.update = function(dt) {
if (this.app.keyboard.wasPressed(pc.KEY_SPACE)) {


    window.open("https://launch.playcanvas.com/1603948","_self");

     }
};

This will not work when published and has nothing to do with this issue but while I was looking at the code I noted this.

1 Like

We are following a written curriculum from E-dynamics learning and it specifically tells students to attach the script to the camera. Would you suggest something else?
Also the MenuScene script is also from a step in the curriculum and it does work when the game is launched as far as using keys to open a new scene within the game.
What would be the problem there?
Thanks for the help!
Also the post effect is working today!

@Ashley_Solano I am just addressing

Yes this method will work perfectly every time the game is launched locally from the editor. If the student publishes the game this type of reference will not work at all.