Hi, I’m basically using Three-Mesh-BVH lib for not allowing the character to pass through the walls.
It works perfectly!
When I reach this door, i slide it giving a path way.
But as you can see (the white mesh) it is also covering my door frame area. Which means I cannot go through it.
How can I achieve this?
My guess is you need to recompute the BVH after the door has moved.
I would keep the door and other animated or moveable components separate from the BVH. The BVH is best for static world elements with complex geometry.
1 Like
@gkjohnson how can I position this moveable component exactly at the position of that “hole”?
I tried to copy the position of that mesh in the model to this moveable component but it doesn’t seems to work.
Also, I’m animating/sliding that door when the player comes near it.BIdeal behaviour is that it should slide left when I’m near it, and as soon as I’m not it should reset back to it’s original position.
But currently it just positions back to (0,0,0).
My guess is the doors position is is relative to the parent at (0,0,0). You probably need to get world position of the door and use that vector3 position
I would look into Box3.setFromObject to compute the world space bounding box of a specific object like your door.