Questions tagged [meshcollider]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
78 views

Why doesn't MeshCollider work in a build?

I have MeshColliders in my scene that are shaped like an hourglass and it works perfectly fine in the editor. However, once I build on XCode and test on my iPhone, ...
12 votes
2 answers
3k views

Moving player inside of moving spaceship?

INTRO: I am trying to achieve a spaceship that flies through space and the pilot can get out of their seat and walk around the ship and place physics objects in it while the ship is moving, rotating, ...
  • 169
0 votes
1 answer
63 views

My First Person Player Capsule Is Always About 6 inches Under The Floor

Here is the problem. This is the exterior of the hallway in which my player capsule is standing. Notice the bottom of the capsule poking through the floor. This is the interior of the hallway, notice ...
0 votes
0 answers
30 views

Unity - using Colliders with custom objects

Hi so I'm quite new to Unity and currently experiencing issues with colliders, a quick summary of what I have. Player > ...
  • 1
2 votes
1 answer
688 views

Optimizing 3D tile-based geometry

For my game, I have a tool that lets me quickly create map geometry. You can see a (albeit early version) demo of the tool here. The main problem with the tool is that even a semi-large map can EASILY ...
  • 1,019
0 votes
0 answers
43 views

Auto-generate optimal direction for Unity Raycast with specifications

How can I have a Physics.Raycast auto-generate a direction for itself to try to hit a given target through a restricted window of space? [Update] After much work, ...
  • 105
0 votes
1 answer
342 views

Mesh getting offset on combine because of worldmatrix

When I try to combine my mesh, it get offset to an other position, but the collider is still at the same place (because i dont delete and add it again). I saw a fix on internet that is to do: ...
0 votes
0 answers
1k views

Unity Raycasting only hitting mesh colliders from particular directions

I have a game which involves clicking to select some objects. Each of the objects has a mesh collider attached to it so that objects can be clicked, handled by the following: ...
0 votes
1 answer
151 views

Why is my mesh outside its collision component grid?

I've created a blueprint (well, two of them, as a test since the first one wasn't working right) with an sphere component around a mesh, as in the picture: As you can see, the mesh is well placed ...
  • 101
1 vote
1 answer
137 views

Why do my NPC's fall through the world when I select them as triggers?

I'm making a game in Unity where when the player comes into contact with an NPC it will switch scenes. I have the code for it and made sure all NPC's have rigidbody as well as using gravity and convex....
0 votes
1 answer
195 views

How can I set my non-convex object's collision to a more detailed one to allow other objects to go underneath?

My problem is simple. I imported a 3D object (it's not convex) and I want the character to go under your legs. But this does not happen: There seems to be a way to do this, I just do not know which ...
0 votes
1 answer
296 views

How do i prevent my player from walking through mesh collider

I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I ...
  • 136
2 votes
1 answer
1k views

Unity SphereCast HitInfo Give me an interpolation of the normal surface?

I'm doing a SphereCast for a GroundCheck of a player. I have my Raycast hitInfo, and here in the picture at the left, I Debug.drawRay in black the direction of the hitInfo.normal every frame It seems ...
  • 281
0 votes
2 answers
646 views

Sometimes can't use the rendered mesh as a collider in Unity?

Most of the times I can use the Mesh Filter's mesh as collider in Mesh Collider But sometimes there is just nothing. No ...
  • 661
1 vote
1 answer
8k views

How to check for mesh overlap?

I'm creating a level editor in Unity. I need to detect when an object is intersecting another as I don't want to allow the user to place an object when it is colliding with something else. In the ...
  • 2,729
1 vote
1 answer
180 views

How do I determine distance of a point within a ProBuilder mesh?

As in the title, I have an effect prepped for my game which applies certain derived parameters to a post-processing effect after the player enters a boundary I created with ProBuilder. Finding how far ...
2 votes
2 answers
930 views

Why does Unity's MeshCollider only use SharedMesh?

For components like MeshRenderer, Unity uses two references to mesh through script--mesh, and sharedMesh. My understanding as of yet that setting a "sharedMesh" will affect every GameObject that uses ...
0 votes
1 answer
4k views

How can I apply a mesh collider in Unity to an entire imported model rather than a single piece?

I have a series of models from Blender I'm importing to Unity as .blend files and I need mesh colliders applied to each one. What I'm finding is that with any model that is constructed of multiple ...
0 votes
1 answer
373 views

Trouble with assigning a model's own mesh to a mesh collider in Unity

I'm trying to use a mesh collider on the player's avatar, rather than the box collider. I've added the mesh collider to the game object (which also has a rigid body) and selected the "convex" ...
4 votes
2 answers
2k views

Unity: Create large Terrain with accurate raycast detection?

I'm not using the Unity Terrain because it lacks certain features. Amongst them, you cannot tile them: You cannot create concave walls or make holes in it: No custom textures, no detail textures, ...
  • 619
5 votes
3 answers
25k views

Unity: How is a Mesh Collider "performance expensive"?

Do Mesh Colliders slow down performance simply by existing or only when they are colliding? Do they directly impact FPS or do they slow down the in-game physics?
  • 619
1 vote
1 answer
10k views

Unity - How do I make non-convex Meshes collide with physics?

Whenever I add a Rigidbody component to an object with a non-Convex Mesh, Unity throws this error: Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5. If you ...
0 votes
1 answer
497 views

Raycast drawing and hitting limited to inside cylinder

I'm trying to get a very basic "radar" system to work. Right now, I'm not even scanning, just looking at a known target location. ...
1 vote
1 answer
2k views

Unity5 using non-convex meshcollider with rigidbody

I want to build a car using wheel collider, mesh collider and rigidbody. The problem is that unity wants the meshcollider to be convex, and that cannot happen because my base model is bigger than 255 ...
0 votes
2 answers
1k views

Detecting when a car is out of the track

I am completely new to Unity 3D, just started to follow some tutorials y'day. I am trying to build a 2D car racing game as a part of my learning (time beating, no opponents). I have a racing track as ...
0 votes
1 answer
4k views

Can you get polygon collider 2d shape from a sprite?

When you create an object with polygon collider 2d from inspector, unity automatically generates polygon collider that approximately fits the sprite. My question is if there is a way to do that when ...
  • 143
23 votes
4 answers
8k views

Should a wall be created as a plane or as a box?

What are the benefits of a wall being as a plane or as a box? Should I use a plane with a box collider instead of mesh collider?
4 votes
0 answers
943 views

Unity & Alternatives to non-convex collider + non-kinematic rigidbody

I am working on a voxel game, where everything is one or more chunks of voxels (16x16x16). As voxels can be destroyed the chunk and collision area changes and can of course become non convex. So to ...
4 votes
4 answers
13k views

How to create a box collider that surrounds an object and its children?

I have a car that needs a box collider. If the car were 1 single mesh, I would only need to call: boxCol = gameObject.AddComponent<BoxCollider>(); ...
  • 1,382
1 vote
2 answers
410 views

Replace PolygonCollider2D with MeshCollider at runtime

I am using a PolygonCollider2D to load in points for a MeshCollider at runtime, but am having issues switching between the two at runtime using good coding practices. This is a simplified version of ...
  • 93
3 votes
0 answers
948 views

Unity raycast misses convex mesh collider

I have a bunch of fighter AIs that are doing attack runs on a target (Currently just a cylinder). It is designed to veer off course the moment it gets too close and loop around for another attack ...
  • 1,401
-1 votes
1 answer
766 views

How to give a mesh collider gravity 5.0

I was trying to make a simulation of an object that needs gravity to work, a hydraulic movement-assistance system for disabled people. All parts are aligned properly, all objects have mesh colliders ...
1 vote
0 answers
82 views

How to create words as objects in Unity?

I am working on a game that has words as obstacles, i.e. the player needs to climb over and around them. There will be hundreds of words in the game therefore I need a way to automate the placement. I ...
0 votes
0 answers
171 views

How to prevent object from moving when it's mesh/collider is being updated?

So I a made a script that lets the player grab a vertex, move it, and then update the mesh. To help prevent the player from trying to clip it through other objects I made it so the mesh/collider is ...
  • 319
1 vote
1 answer
3k views

Unity mesh collider detecting collision on object empty inside

I'm trying to get my first 3D game done with Unity. In this game the character will be flying through some rings. I made the ring asset with MagicaVoxel, exported it in .obj and reimported in Unity ...
7 votes
2 answers
8k views

How do I fix the bug where my Rigidbody gets stuck on the edge of two Colliders?

The boxes are standing right next to each other, but somehow, the player manages to collide with the ghost edge. I use AddForce to control the player with a Box ...
4 votes
1 answer
2k views

Matching collider to character mesh size in different postures

What's the optimal method in Unity to match the size of a Capsule Collider to the actual size of the game object it is part of? To understand what I'm trying to do ...
3 votes
3 answers
8k views

Player Flying after colliding - Unity

I have a Player with a capsule collider on him and i have various objects in the scene. Most of the objects have either mesh collider or box collider enabled. When i move my player and the player ...
1 vote
1 answer
126 views

Selecting Objects to Prefab Unity

So... I have a tree object and I have duplicated it to have many trees in the scene. So, I have about 200 trees in the scene. Before duplicating I forgot to add a tree as a prefab. Now, is there ...
1 vote
3 answers
8k views

Invalid AABB aabb

...
2 votes
3 answers
534 views

Colliders for moving inside a spaceship when the whole spaceship is made of a single mesh (in Unity)

I've begun to study a unity engine in one purpose: I have a great multi player game idea! The main essence: In space there are two (or even more) huge spaceships with crew consisted of players (all ...
1 vote
1 answer
440 views

Unity3d Colliders not working on my characters [closed]

I have create 2 characters in maya and imported them in Unity3d. I am able to move and animate them in unity but the characters are not colliding with each others. I have tried all major colliders ...
  • 19
0 votes
0 answers
244 views

Object doesn't move smooth over edges?

In the last couple of days I'm experimenting a lot with Unity 3D to get a feeling about the environment and the behavior of game development. I come from a programming perspective and try to develop ...
's user avatar
5 votes
1 answer
4k views

Space Shooter Unity 5 Collisions not working

After upgrading the official Space Shooter Tutorial to Unity 5, collisions stop working. Additionally, the following error is reported: Non-convex MeshColliders with non-kinematic Rigidbodies are no ...