Is there a way to detect a collision but stop the phyiscal response

I’m not entirely sure if the question makes sense with other people but in my mind I’m wanting to detect a collision but instead of not being able to go through the object when colliding I want to stop the physical response.

I have some code that I have downloaded and messed around with but am not entirely sure of where this would take place. Any help would be good as i’ve been stuck on this. At the moment I’m trying to register when a player enters the “zone” which then says “you are in the spawn zone” when they go out of the zone it says “not in spawn zone”. So all i’m needing is to stop the phyiscal response of the Cube which i’m not sure how to do.

At the moment I have a box but i can collide with it, i’ve looked at settings to check whether i can turn this off but i don’t see anything.

const zone = new BABYLON.MeshBuilder.CreateBox(“box”, {
width: 300,
height: 200,
depth: 700,
}, scene);

zone.position.x = -100;
zone.position.y = 350;
zone.position.z = 0;
zone.collisionMask = 0;
zone.material = new BABYLON.StandardMaterial("box", scene);
zone.showBoundingBox = true;


Hey, yes that’s what I want however my camera / player collides with the Box and can’t go through it

What I have at the moment is this: Download You will have to run the folder with a http server as the files are imported in the browser

If it’s a box collision object, I don’t know the exact math, but you could try something like calculating collision manually every tick by getting the distance between the player’s location and the box’s corner vertices < some max value.

Only problem I have is as it’s not my code i am actually developing from that Im not sure where this problem lies. I am wanting to just stop the collision response when i intersect with the cube, i have no diea where this is handled

read from line 58

scene.registerBeforeRender(function () {
if (yourTargetMesh.intersectsMesh(yourMesh, true)) {
yourTargetMesh.material.emissiveColor = new BABYLON.Color3(1, 0, 0);
} else {
yourTargetMesh.material.emissiveColor = new BABYLON.Color3(1, 1, 1);

this part of code add and execute conditional function before every frame render. if yourTargetMesh intersectsMesh yourMesh then yourTargetMesh material set emissive color to red else yourTargetMesh material set emissive color to white. so you can do there what you want and for this you dont need use physics engines. just use mesh.intersectsMesh(yourMesh, true) and return true or false or something else before every frame render

As i’ve already said there is a Physics engine but i don’t see where i can remove this in the code, it’s not mine as i got it from somewhere but it’s not their fault as this is a problem that lies with me. i just dont want no phyiscs response from just that cube