Shockwave tutorial seems broken

When I try to run the Shockwave tutorial project from the editor, the pop-up console shows the following (I’m running in Edge on Mac).


[posteffect-shockwave.js?id=5777291&branchId=a50fd831-4217-4404-a544-ed069a96d715:12]: this.shader.link is not a function

TypeError: this.shader.link is not a function
    at Func.ShockwavePostEffect (https://launch.playcanvas.com/api/assets/files/posteffect-shockwave.js?id=5777291&branchId=a50fd831-4217-4404-a544-ed069a96d715:12:21)
    at new Func (https://code.playcanvas.com/playcanvas-stable.dbg.js:56699:9)
    at scriptType.Shockwave.initialize (https://launch.playcanvas.com/api/assets/files/posteffect-shockwave.js?id=5777291&branchId=a50fd831-4217-4404-a544-ed069a96d715:52:19)
    at ScriptComponent._scriptMethod (https://code.playcanvas.com/playcanvas-stable.dbg.js:43308:19)
    at ScriptComponent._onInitialize (https://code.playcanvas.com/playcanvas-stable.dbg.js:43327:12)
    at ScriptComponentSystem._callComponentMethod (https://code.playcanvas.com/playcanvas-stable.dbg.js:43812:49)
    at ScriptComponentSystem._onInitialize (https://code.playcanvas.com/playcanvas-stable.dbg.js:43818:9)
    at Function._helper (https://code.playcanvas.com/playcanvas-stable.dbg.js:28818:12)
    at Function.initialize (https://code.playcanvas.com/playcanvas-stable.dbg.js:28822:9)
    at Application.start (https://code.playcanvas.com/playcanvas-stable.dbg.js:48821:20)
    at https://launch.playcanvas.com/editor/scene/js/launch.js:7357:25
    at Application._preloadScripts (https://code.playcanvas.com/playcanvas-stable.dbg.js:48617:5)
    at https://launch.playcanvas.com/editor/scene/js/launch.js:7340:21
    at done (https://code.playcanvas.com/playcanvas-stable.dbg.js:48559:6)
    at Asset.onAssetLoad (https://code.playcanvas.com/playcanvas-stable.dbg.js:48571:7)
    at Asset.fire (https://code.playcanvas.com/playcanvas-stable.dbg.js:590:18)
    at _opened (https://code.playcanvas.com/playcanvas-stable.dbg.js:26812:11)
    at Array._loaded (https://code.playcanvas.com/playcanvas-stable.dbg.js:26829:6)
    at ResourceLoader._onSuccess (https://code.playcanvas.com/playcanvas-stable.dbg.js:24850:27)
    at https://code.playcanvas.com/playcanvas-stable.dbg.js:24807:13
    at ScriptHandler. (https://code.playcanvas.com/playcanvas-stable.dbg.js:25064:7)
    at HTMLScriptElement.element.onload.element.onreadystatechange (https://code.playcanvas.com/playcanvas-stable.dbg.js:25088:6)

Error loading scripts. Open the browser console for details.

Hi @blairmacintyre and welcome,

Indeed there seems to be using a deprecated and now not necessary function. Just comment out line 12 on the posteffect-shockwave.js script and it will work just fine:

    var ShockwavePostEffect = function (graphicsDevice, fs, vs) {
        // this is the shader definition for our effect
        this.shader = new pc.Shader(graphicsDevice, {
            attributes: {
                aPosition: pc.SEMANTIC_POSITION
            },
            vshader: vs,
            fshader: fs
        });
        //this.shader.link();
    };

@yaustar you may have to update that example project.

1 Like

Thanks, fixed!

1 Like

Thanks @Leonidas @yaustar. I’m really new to Playcanvas (using it for an assignment in my class soon; hoping to use it for a Games class next semester) and was going through some of the tutorials, wasn’t sure what the right fix was, but figured you’d want to know (and assumed the fix would be easy).

1 Like