Walk through object code no longer working (TypeScript)

For some time now, my students and I have used a couple lines of code I found on this forum to allow the player/camera to pass through an object. I have pasted the code below.

But for some reason it has suddenly stopped working. It was working just weeks ago, and now all my CoSpaces where I utilized this no longer function as intended. Has there been an update that changes the way to do this? Is there any way for me to fix this? Any input is greatly appreciated.

//Find the item to be added to the collision filter
const myCharacter = Scene.getItem(“wall1”);

//Add the item to the collision filter
Scene.camera.addToCollisionFilter(myCharacter)

1 Like

The Scene.camera property was deprecated a long time ago and was removed in the last release.
To access scene’s main camera there is a global object Camera.

Camera.addToCollisionFilter(myCharacter)

3 Likes