# \#scripting

**URL:** https://forum.playcanvas.com/tag/scripting/1.md

[Latest](https://forum.playcanvas.com/latest.md) · [Categories](https://forum.playcanvas.com/categories.md) · [Tags](https://forum.playcanvas.com/tags.md)

---

## [Inventory Screen (semi) broken, please help (also, one other issue from a new update to the engine)](https://forum.playcanvas.com/t/inventory-screen-semi-broken-please-help-also-one-other-issue-from-a-new-update-to-the-engine/42629)

<div class="topic-metadata">

**Author:** [@Linkplayer](https://forum.playcanvas.com/u/Linkplayer)\
**Replies:** 5\
**Last updated:** [November 9, 2026, 3:29pm UTC](https://forum.playcanvas.com/t/inventory-screen-semi-broken-please-help-also-one-other-issue-from-a-new-update-to-the-engine/42629 "2026-11-09T15:29:27Z")

</div>

So, I’m making an inventory screen in my game, and it’s working, kind of. I got it working perfectly in the scene for Sector 1, and I copied the screen to other scenes, believing that they would work the same way in all …

---

## [Made some runtime LOD scripts for PlayCanvas (auto mesh simplification, no build step)](https://forum.playcanvas.com/t/made-some-runtime-lod-scripts-for-playcanvas-auto-mesh-simplification-no-build-step/42694)

<div class="topic-metadata">

**Author:** [@5hyun](https://forum.playcanvas.com/u/5hyun)\
**Replies:** 1\
**Last updated:** [October 24, 2026, 3:46pm UTC](https://forum.playcanvas.com/t/made-some-runtime-lod-scripts-for-playcanvas-auto-mesh-simplification-no-build-step/42694 "2026-10-24T15:46:15Z")

</div>

Hey everyone :wave: I’ve been using PlayCanvas for a while now and honestly I love how quickly you can get something running in the browser. One thing I kept missing though was LOD. I didn’t want to make LOD models by h…

---

## [videoTexture on iOS is very bright / "washed-out"](https://forum.playcanvas.com/t/videotexture-on-ios-is-very-bright-washed-out/42670)

<div class="topic-metadata">

**Author:** [@Question2u](https://forum.playcanvas.com/u/Question2u)\
**Replies:** 3\
**Last updated:** [October 13, 2026, 8:23am UTC](https://forum.playcanvas.com/t/videotexture-on-ios-is-very-bright-washed-out/42670 "2026-10-13T08:23:14Z")

</div>

Hi everyone, Since upgrading to PlayCanvas Engine 2.0 (currently 2.23.1), videos loaded from external URLs appear washed out and desaturated on iOS. The same videos looked correct before the upgrade, and other scene mat…

---

## [A error syntax in my code](https://forum.playcanvas.com/t/a-error-syntax-in-my-code/42644)

<div class="topic-metadata">

**Author:** [@Lea-Maude\_Lavigne\_Au](https://forum.playcanvas.com/u/Lea-Maude_Lavigne_Au)\
**Replies:** 1\
**Last updated:** [October 6, 2026, 4:53pm UTC](https://forum.playcanvas.com/t/a-error-syntax-in-my-code/42644 "2026-10-06T16:53:25Z")

</div>

var Playermovement = pc.createScript(‘playermovement’); Playermovement.attributes.add(‘movementSpeed’, {type: ‘number’}); Playermovement.attributes.add(‘turnSpeed’, {type: ‘number’}); Playermovement.attributes.add(‘ju…

---

## [Are there any plans to add SSR (screen space reflection) functionality?](https://forum.playcanvas.com/t/are-there-any-plans-to-add-ssr-screen-space-reflection-functionality/36796)

<div class="topic-metadata">

**Author:** [@mmm\_nnn](https://forum.playcanvas.com/u/mmm_nnn)\
**Replies:** 3\
**Last updated:** [October 1, 2026, 5:09pm UTC](https://forum.playcanvas.com/t/are-there-any-plans-to-add-ssr-screen-space-reflection-functionality/36796 "2026-10-01T17:09:51Z")

</div>

Hi. Are there any plans to add SSR (screen space reflection) functionality? The playcanvas engine can render very nicely depending on the settings. I think this quality can be utilized for sales promotion of various p…

---

## [Outline effect for V2 engine](https://forum.playcanvas.com/t/outline-effect-for-v2-engine/42634)

<div class="topic-metadata">

**Author:** [@jerryComo](https://forum.playcanvas.com/u/jerryComo)\
**Replies:** 11\
**Last updated:** [September 30, 2026, 8:03am UTC](https://forum.playcanvas.com/t/outline-effect-for-v2-engine/42634 "2026-09-30T08:03:46Z")

</div>

Hi - the ApplyOutline.js effect is no longer working in V2, and I’ve tried updating it with claude but to no success. Has anyone created an outline effect - that can show on specific entities - for V2 ? ok cheers ! -J…

---

## [Is my code correct?](https://forum.playcanvas.com/t/is-my-code-correct/42434)

<div class="topic-metadata">

**Author:** [@Brent\_Reddick1](https://forum.playcanvas.com/u/Brent_Reddick1)\
**Replies:** 4\
**Last updated:** [September 20, 2026, 10:39pm UTC](https://forum.playcanvas.com/t/is-my-code-correct/42434 "2026-09-20T22:39:18Z")

</div>

I’m trying to make a trigger script but it just doesn’t work! var TrigKill = pc.createScript('Trigkill'); TrigKill.attributes.add('kill', {type : 'entity'}); // initialize code called once per entity TrigKill.prototype…

---

## [Entity Movement Constraint Issue — Door Passing Through Wall During Placement](https://forum.playcanvas.com/t/entity-movement-constraint-issue-door-passing-through-wall-during-placement/41087)

<div class="topic-metadata">

**Author:** [@Asad\_Sheikh](https://forum.playcanvas.com/u/Asad_Sheikh)\
**Replies:** 6\
**Last updated:** [September 7, 2026, 11:37am UTC](https://forum.playcanvas.com/t/entity-movement-constraint-issue-door-passing-through-wall-during-placement/41087 "2026-09-07T11:37:56Z")

</div>

Hi everyone, I’m working on a PlayCanvas 3D configurator project that involves multiple shed models. Each shed can have different door types that can be installed, removed, and moved along the shed walls using raycastin…

---

## [Dynamically loaded texture asset appears whiter when applied to UI](https://forum.playcanvas.com/t/dynamically-loaded-texture-asset-appears-whiter-when-applied-to-ui/42518)

<div class="topic-metadata">

**Author:** [@Christopher\_Poole1](https://forum.playcanvas.com/u/Christopher_Poole1)\
**Replies:** 4\
**Last updated:** [August 17, 2026, 7:16pm UTC](https://forum.playcanvas.com/t/dynamically-loaded-texture-asset-appears-whiter-when-applied-to-ui/42518 "2026-08-17T19:16:34Z")

</div>

Below you can see 2 ui image elements, both using the same png except the one on the left was imported into the PlayCanvas editor and the one on the right was imported at runtime. Below them is the same example except th…

---

## [All console.log messages come from runtime.ts:51](https://forum.playcanvas.com/t/all-console-log-messages-come-from-runtime-ts-51/42469)

<div class="topic-metadata">

**Author:** [@fleity](https://forum.playcanvas.com/u/fleity)\
**Replies:** 2\
**Last updated:** [July 28, 2026, 3:02pm UTC](https://forum.playcanvas.com/t/all-console-log-messages-come-from-runtime-ts-51/42469 "2026-07-28T15:02:13Z")

</div>

Since a few days, in all my projects, when launching from the editor, every call to console.log() in displayed as coming from mcp/runtime.ts. Same issue with console.debug(). But console.trace() still shows correct scri…

---

## [How can I integrate the built-in editor in playcanvas.js into the cursor AI editor](https://forum.playcanvas.com/t/how-can-i-integrate-the-built-in-editor-in-playcanvas-js-into-the-cursor-ai-editor/42450)

<div class="topic-metadata">

**Author:** [@guoxiaohao](https://forum.playcanvas.com/u/guoxiaohao)\
**Replies:** 3\
**Last updated:** [July 20, 2026, 9:43am UTC](https://forum.playcanvas.com/t/how-can-i-integrate-the-built-in-editor-in-playcanvas-js-into-the-cursor-ai-editor/42450 "2026-07-20T09:43:09Z")

</div>

I hope to integrate cursor into playcanva.js. Is it currently supported

---

## [End Trigger stops working randomly](https://forum.playcanvas.com/t/end-trigger-stops-working-randomly/42439)

<div class="topic-metadata">

**Author:** [@Brent\_Reddick1](https://forum.playcanvas.com/u/Brent_Reddick1)\
**Replies:** 2\
**Last updated:** [July 19, 2026, 9:08am UTC](https://forum.playcanvas.com/t/end-trigger-stops-working-randomly/42439 "2026-07-19T09:08:09Z")

</div>

the problem is a little hard to explain, so here is a video of me explaining it! project link → PlayCanvas | HTML5 Game Engine Thanks in advance!

---

## [Help with custom kinematic/dynamic rigidbody movement engine](https://forum.playcanvas.com/t/help-with-custom-kinematic-dynamic-rigidbody-movement-engine/42412)

<div class="topic-metadata">

**Author:** [@Linkplayer](https://forum.playcanvas.com/u/Linkplayer)\
**Replies:** 8\
**Last updated:** [July 7, 2026, 3:18pm UTC](https://forum.playcanvas.com/t/help-with-custom-kinematic-dynamic-rigidbody-movement-engine/42412 "2026-07-07T15:18:15Z")

</div>

So, this is going to sound a bit weird, but for my 2D game, I’m making a 3D version alongside it. I’m doing it for the cutscenes, which are going to be pre-rendered recordings of me playing back things in the 3D thing, b…

---

## [Collision null when entity destroyed , so listener cant be 'offed'](https://forum.playcanvas.com/t/collision-null-when-entity-destroyed-so-listener-cant-be-offed/42340)

<div class="topic-metadata">

**Author:** [@jerryComo](https://forum.playcanvas.com/u/jerryComo)\
**Replies:** 1\
**Last updated:** [June 4, 2026, 12:14pm UTC](https://forum.playcanvas.com/t/collision-null-when-entity-destroyed-so-listener-cant-be-offed/42340 "2026-06-04T12:14:37Z")

</div>

Hi - I would like to switch these listeners off when the scene this entity is changed - but the collision is null when the entity is destroyed, so I can’t without causing an error. I’m not removing it elsewhere, so wher…

---

## [Can somone fix this its makin me mad](https://forum.playcanvas.com/t/can-somone-fix-this-its-makin-me-mad/42229)

<div class="topic-metadata">

**Author:** [@131241335245](https://forum.playcanvas.com/u/131241335245)\
**Replies:** 1\
**Last updated:** [May 10, 2026, 12:47pm UTC](https://forum.playcanvas.com/t/can-somone-fix-this-its-makin-me-mad/42229 "2026-05-10T12:47:37Z")

</div>

This was edited with ai i could find the reason myself nether could ai i want bmgdrive type driving phis var CarController = pc.createScript(‘carController’); CarController.prototype.initialize = function () { // — MO…

---

## [Random Crash/freeze up that I can't find the cause of](https://forum.playcanvas.com/t/random-crash-freeze-up-that-i-cant-find-the-cause-of/42189)

<div class="topic-metadata">

**Author:** [@Linkplayer](https://forum.playcanvas.com/u/Linkplayer)\
**Replies:** 6\
**Last updated:** [April 27, 2026, 5:22pm UTC](https://forum.playcanvas.com/t/random-crash-freeze-up-that-i-cant-find-the-cause-of/42189 "2026-04-27T17:22:43Z")

</div>

I haven’t really touched this project in quite a while because all my time was taken up with school, but now that I have time, I have just started working on it again. Now there is a strange bug that I can’t figure out h…

---

## [Standalone + TypeScript - Create a script and add it to Entity](https://forum.playcanvas.com/t/standalone-typescript-create-a-script-and-add-it-to-entity/37926)

<div class="topic-metadata">

**Author:** [@vasshu](https://forum.playcanvas.com/u/vasshu)\
**Replies:** 4\
**Last updated:** [October 15, 2024, 10:57am UTC](https://forum.playcanvas.com/t/standalone-typescript-create-a-script-and-add-it-to-entity/37926 "2024-10-15T10:57:08Z")

</div>

The examples I’ve looked at use scripts written in JavaScript and stored in separate files. Maybe I didn’t see the right example, but how do I create a TypeScript script and how do I attach it to an entity in the Standal…

---

## [Scoring system rewards](https://forum.playcanvas.com/t/scoring-system-rewards/42130)

<div class="topic-metadata">

**Author:** [@Aksel\_Walztoni](https://forum.playcanvas.com/u/Aksel_Walztoni)\
**Replies:** 1\
**Last updated:** [April 10, 2026, 3:01pm UTC](https://forum.playcanvas.com/t/scoring-system-rewards/42130 "2026-04-10T15:01:16Z")

</div>

Hi, how would I make it so when a certain score is reached, an event triggers?

---

## [Executing ESM scripts directly within the PlayCanvas Editor viewport](https://forum.playcanvas.com/t/executing-esm-scripts-directly-within-the-playcanvas-editor-viewport/42107)

<div class="topic-metadata">

**Author:** [@smth-mmusso](https://forum.playcanvas.com/u/smth-mmusso)\
**Replies:** 2\
**Last updated:** [April 2, 2026, 2:41pm UTC](https://forum.playcanvas.com/t/executing-esm-scripts-directly-within-the-playcanvas-editor-viewport/42107 "2026-04-02T14:41:20Z")

</div>

Hi everyone, I’m working on a project using the new ESM modules. I would like to know if there is a way to have these scripts execute directly inside the Editor’s viewport, allowing me to see logic or visual changes in …

---

## [Simple script: Support for UI Element Group opacity](https://forum.playcanvas.com/t/simple-script-support-for-ui-element-group-opacity/42072)

<div class="topic-metadata">

**Author:** [@underlight](https://forum.playcanvas.com/u/underlight)\
**Replies:** 1\
**Last updated:** [March 24, 2026, 4:14pm UTC](https://forum.playcanvas.com/t/simple-script-support-for-ui-element-group-opacity/42072 "2026-03-24T16:14:26Z")

</div>

Hey guys! As you probably know, by default opacity isn’t supported in UI Elements of type group, hence you can’t change global opacity of grouped UI elements, layouts, etc - neither in Editor nor in script, which is ver…

---

## [ESM Scripts - Nested Classes?](https://forum.playcanvas.com/t/esm-scripts-nested-classes/42071)

<div class="topic-metadata">

**Author:** [@lemonmad](https://forum.playcanvas.com/u/lemonmad)\
**Replies:** 2\
**Last updated:** [March 23, 2026, 9:03am UTC](https://forum.playcanvas.com/t/esm-scripts-nested-classes/42071 "2026-03-23T09:03:43Z")

</div>

Hi all Is there anyone with experience using ESM scripts that can explain why this script isn’t working as expected? the visibleif tags aren’t working, everything is always visible in editor regardless. when I click a…

---

## [I need help on making these maps](https://forum.playcanvas.com/t/i-need-help-on-making-these-maps/42028)

<div class="topic-metadata">

**Author:** [@Kobayashi](https://forum.playcanvas.com/u/Kobayashi)\
**Replies:** 2\
**Last updated:** [March 14, 2026, 1:01am UTC](https://forum.playcanvas.com/t/i-need-help-on-making-these-maps/42028 "2026-03-14T01:01:59Z")

</div>

i made a full map and a working camera im also tryna do the movement idk how to fix this and i dont know how to make characters the map you fall in it under the map heres the share link so you can try it PlayCanvas | HTM…

---

## [Game breaking randomly](https://forum.playcanvas.com/t/game-breaking-randomly/41986)

<div class="topic-metadata">

**Author:** [@existism](https://forum.playcanvas.com/u/existism)\
**Replies:** 7\
**Last updated:** [March 5, 2026, 1:31am UTC](https://forum.playcanvas.com/t/game-breaking-randomly/41986 "2026-03-05T01:31:40Z")

</div>

hey so basically whats happening is if you play the game, sometimes randomly the game will break, and the wave wont go up again and ive been trying to figure out what is causing it but I cant. game theres the link so i…

---

## [Playing Animation States and Stopping them using Code](https://forum.playcanvas.com/t/playing-animation-states-and-stopping-them-using-code/41962)

<div class="topic-metadata">

**Author:** [@noah\_mizrahi](https://forum.playcanvas.com/u/noah_mizrahi)\
**Replies:** 3\
**Last updated:** [February 28, 2026, 8:00am UTC](https://forum.playcanvas.com/t/playing-animation-states-and-stopping-them-using-code/41962 "2026-02-28T08:00:24Z")

</div>

We are launching a game with playcanvas with a lot of very small animated characters. We have built a pipeline where animation assets are loaded from the registry and we are also bypassing creating a state graph asse. In…

---

## [Script not giving expected result](https://forum.playcanvas.com/t/script-not-giving-expected-result/41964)

<div class="topic-metadata">

**Author:** [@m3168366](https://forum.playcanvas.com/u/m3168366)\
**Replies:** 1\
**Last updated:** [February 27, 2026, 2:46pm UTC](https://forum.playcanvas.com/t/script-not-giving-expected-result/41964 "2026-02-27T14:46:42Z")

</div>

Hey guys, what did I wrong in this script? PlayerMovement.attributes.add('turnSpeed', {type: 'number'});\` //rotation if(this.app.keyboard.isPressed(pc.KEY\_Q)) ( this.entity.rigidbody.applyTorque(0,this.turnSpeed,0)…

---

## [\[SOLVED\] Is there some issue with attributes in the editor?](https://forum.playcanvas.com/t/solved-is-there-some-issue-with-attributes-in-the-editor/41952)

<div class="topic-metadata">

**Author:** [@3dTim](https://forum.playcanvas.com/u/3dTim)\
**Replies:** 2\
**Last updated:** [February 26, 2026, 3:21pm UTC](https://forum.playcanvas.com/t/solved-is-there-some-issue-with-attributes-in-the-editor/41952 "2026-02-26T15:21:19Z")

</div>

I’m finding that newly added script attributes are not showing up in the editor. https://playcanvas.com/project/1474937/overview/blank-project

---

## [Should I fire an event on the script component or the entity?](https://forum.playcanvas.com/t/should-i-fire-an-event-on-the-script-component-or-the-entity/41942)

<div class="topic-metadata">

**Author:** [@Trigger](https://forum.playcanvas.com/u/Trigger)\
**Replies:** 1\
**Last updated:** [February 24, 2026, 6:40pm UTC](https://forum.playcanvas.com/t/should-i-fire-an-event-on-the-script-component-or-the-entity/41942 "2026-02-24T18:40:39Z")

</div>

Say I have a script component that fires an event. Should I fire the event on the script component or the entity? Which is the standard approach in PlayCanvas? Script component fires an event: this.fire('load'); Users…

---

## [\[SOLVED\] Import map issue seems to be back](https://forum.playcanvas.com/t/solved-import-map-issue-seems-to-be-back/41890)

<div class="topic-metadata">

**Author:** [@luisacmazzi](https://forum.playcanvas.com/u/luisacmazzi)\
**Replies:** 4\
**Last updated:** [February 17, 2026, 8:12pm UTC](https://forum.playcanvas.com/t/solved-import-map-issue-seems-to-be-back/41890 "2026-02-17T20:12:29Z")

</div>

Hi, it seems like the editor’s import map issue is back. Launched like this: Can anyone please verify if something went wrong after the previous fixes? 10 days ago (as of my previous post) it appeared to be workin…

---

## [Car system, local coordinates, and applyforce](https://forum.playcanvas.com/t/car-system-local-coordinates-and-applyforce/41838)

<div class="topic-metadata">

**Author:** [@Aksel\_Walztoni](https://forum.playcanvas.com/u/Aksel_Walztoni)\
**Replies:** 1\
**Last updated:** [February 6, 2026, 9:01am UTC](https://forum.playcanvas.com/t/car-system-local-coordinates-and-applyforce/41838 "2026-02-06T09:01:03Z")

</div>

I am making a system for a car, and I am trying to make it follow local coordinates to move forward. I have looked up everything, and everything I tried hasn’t worked. Currently, it is using applyForce to move, and it on…

---

## [\[SOLVED\] Point an empty entity with a sprite child towards mouse](https://forum.playcanvas.com/t/solved-point-an-empty-entity-with-a-sprite-child-towards-mouse/41813)

<div class="topic-metadata">

**Author:** [@existism](https://forum.playcanvas.com/u/existism)\
**Replies:** 8\
**Last updated:** [February 5, 2026, 1:40am UTC](https://forum.playcanvas.com/t/solved-point-an-empty-entity-with-a-sprite-child-towards-mouse/41813 "2026-02-05T01:40:01Z")

</div>

So basically im making a 2d game and I have an empty object called pivot and I want it to turn towards the camera and there is a sprite under it. This pivot object is also under an empty called Player. I tried implementi…

[Next page](https://forum.playcanvas.com/tag/scripting/1.md?match_all_tags=true&page=1&tags%5B%5D=scripting)
