How to Camera Collide with Non-Collide Objects

So basically I have some Meshparts which I have CanCollide Off, the problem is that this also makes the camera able to go through the part and you can actually go inside and have like “xray”

Example ( this tunnel have CanCollide off)

Video: https://gyazo.com/bb0a11f61f5e2e3256c9405f3ad39537

Is there any way I can disable collisions with players but enable collisions with player camera?
Any help is appreciated!

5 Likes

Hi there!

I’ve been trying to read through the question several times, but can’t seem to figure out what exactly you mean. Could you try to rephrase it perhaps? I would really love to help, and i might know the solution for it. :slight_smile:

Kevin

2 Likes

He means that he wants the camera to not be able to move through objects, while players can still move through them. So the parts being canCollide = false in relation to the player but can Collide = true for the camera.

2 Likes

Oh i get it now, awesome.

I’ll see what i can do to figure this out.

1 Like

Alright, so from what I can see, it would only be possible with a script. Though, it might be a different story if there’s a separate mesh from the tube like a mountain or something, because it seems really odd that it can go through the mountain if it’s a separate part/mesh.

1 Like

Well, currently I am trying to find out a solution without programming, the reason this tunnel has Collide off is because comes from Blender and the collisions are off, so basically I disabled its collisions and recreated the shape wtih Roblox parts, which, right now, works perfectly, the only problem is the camera thing

1 Like

Can you send a link to the game perhaps? Will do my best to figure something out, no promises though.

1 Like

You could accomplish this by creating 2 collision groups, one for characters and another for the parts you need the camera to collide with. After creating them, set them both collidable with the default group but noncollidable with each other. Then use a script to put the characters in the character collision group when they join the game.

5 Likes

The Camera will collide with CanCollide Parts that aren’t Transparent.
Could you make your “Roblox parts” not Transparent so they will stop the camera?

1 Like

This probably one of the best solutions but, as I said I am not looking for programming solutions, specially because I do not program and because this is for a client and not for my own game or project
Anyways, thank you so much for your time

I think this is the only way, the transparent parts have to transparent but, I can recreate the tunnel outside with parts or just make a barrier with roblox parts, this is kinda messy but its like the only way I can accomplish it without scripting

Saw that there is no usable response on this yet. I’m facing the same problem now. I have a hill mesh and a collision mesh in the same position. The hill mesh is non-collision. The hill mesh is opaque and the collision mesh is transparent. So now when a player stands near the hill but facing away from it, the camera gets inside the hill making all things under it visible.

Why 2 Meshes?
If Hill Mesh is fairly large and the shape is complex then try setting the Collision Fidelity to Precise. It may help you out.

Another alternative is to make the Collision Mesh Transparency something like .99 so it’s almost transparent so the camera won’t move inside it.

Hey, how you doing?

I have a simple method that I use, follow these steps:

  1. Add a mesh (Classname: SpecialMesh) inside your tunnel part/union.
  2. Set meshtype to “FileMesh”
  3. Check if these settings match:
    Scale: 0,0,0
    Offset: 0,0,0

Hey @Scottifly , thanks for the response. Have tried already with Precise collision fidelity on the actual mesh. But it does not work if the faces of the mesh are joined. They need to be separated into individual faces… See, I’ve attached pics on how good the separate collision works.

With Precise collision fidelity on the main hill mesh


Collision mesh added.

Made main mesh non-collision, and collision mesh with precise collision fidelity and invisible.
Does not float and stands correctly.

But the camera goes behind the mesh.

hi @all_xValen , did not understand where to add it.
I tried adding the SpecialMesh under the collision mesh and set the properties as you said. Didn’t work. Then added the collision mesh texture id to it. Also tried moving it to the Group (hilll mesh + collision mesh). Nothing worked. How to do this? Can you give more details please?

It might be best if you cut your MeshPart down into smaller pieces.
From what I’ve seen if you have huge MeshParts or Unions they tend to do exactly what you are seeing because the physical shape is more of an average.
Maybe cut your large mountain mesh into smaller chunks so their physical shape matches their rendered shape better.

Either that or just use Terrain.