[SOLVED] Mesh Trigger Not Working

I have a damage Wall that uses a mesh collision type and it slowly shrinks in but it won’t activate when a rigidbody enters its collision like it’s supposed to.
It does give 1 error which is a warning in the editor that says
“Warning!
This entity has a non-uniform scale. Mesh collision will not work as expected.”
But I need to be non-uniform so the player can’t jump over it what do I do?

Here is the code attached to the wall
https://playcanvas.com/editor/code/843141?tabs=60269978

Hi @WilliamBoersma31! In order to help, we need to be able to view all parts. The project, the scene, the involved entities and scripts. Otherwise, it’s impossible to get a good idea of ​​what you’re trying to achieve and what the problem might be. Alternatively, you can set up a small sample project. This also guarantees the privacy of your project.

Hi @Albertos !
Here is a link to the scene where the issue occurs
https://playcanvas.com/editor/scene/1258388

the entity is called ouch wall its under BR Map then Under Ouch Walls

I just checked a few things and at first glance I don’t see anything that stands out. I recommend trying to see if it works without resizing the wall and also see if using a primitive as the collision type solves the problem.

If I understand correctly, the goal is for the player to stay within the walls? In that case you can also use a cylinder with a reverse method. The player may not get outside this cylinder.

hey @Albertos this is weird I made it an uniform size and stopped the movement and now it works but it only works when your on the edge of the mesh

and even when it’s uniform it still doesn’t work if you use the movement

I’m still not sure what your goal is. If your player is inside the mesh it’s normal it doesn’t detect a onTriggerEnter as far as I know.

Yeah I’ve written a if statement that says

if (this.Ouch) {
damage.player
}

and on trigger enter it sets this.Ouch to true and on trigger leave it sets this.Ouch to false

I think this is as expected. What is the problem with it?

I suggest again to use a cylinder (or box) that represent the ‘safe area’. If the player is outside the area you can ‘take the damage’. I think that is what your goal is?

even when the mesh doesn’t move it detects an on trigger leave when you go further inside the mesh it seems the collision doesn’t fill in the mesh. if it where a box for example it works just fine.
and I think I’ll probably have to go with that strategy.

is there a way to check weather or not an entity is inside a trigger

With your triggerEnter function you know it’s inside the trigger? Another option is to check the distance from a specific point. If the distance is a certain value you can execute your action.

Hey @Albertos can you give some example code?

Can you explain me first what your goal is? Why can a player inside the mesh of your wall? What kind of wall is it then? Below is what I see, so it’s hard to understand what you try to achieve.

Never mind I figured it out and the wall is a damage barrier that slowly shrinks to slowly push then players together to get the players to fight so the match doesn’t last 4 years also while I have your attention can you take a look at this topic Checking if a game is started Net Code - #4 by Leonidas

1 Like

Next time please start with this information, then it would be easier to think along with you. :crazy_face: