- Home /
Creating 2D collider from 3D mesh
Is there any way to: Instead of making it from 2D image sprite, I want to make Polygon Collider 2D from mesh. This mesh is just a shape triangulated in Blender, a flat 3D model with all vertices on Z = 0.
The algorythm for this should be way easier than for existing for 2D sprites. Doing this manually would be nearly impossible due to mesh complexness and the fact that 3D and 2D physics have nothing in common.
i dont think any algorithm is neccessary. on the rigidbody component, freeze the z position. If you cant use a rigid body for whatever reason, then something like this
public int speed;
void OnCollisionEnter(Collision other)
{
transform.Translate(Vector3.DIRECTION * Time.deltaTime * speed);
}
//obviously youd type the direction it needs to move, not literally DIRECTION
Your answer
Follow this Question
Related Questions
Returning list of Triangles, Vertices or Points by raycasting through a mesh (iPhone) 1 Answer
Using collider to gameobject detect attack or not 2 Answers
Is it possible to rotate a 2d collider in 3d? 0 Answers
Mesh Collider Bounciness working only in a few areas 1 Answer
Applying a Proper Mesh Collider to a Blender Import 4 Answers