- Home /
Best approach for collision in shape combination game?
I am not very familiar with Unity yet and I was looking for advice on the best approach for combining shapes in a game in real time to make bigger shapes. For those from the UK think "fuzzy felts". For gamers think Katamari damacy but in a mostly 2d kind of way.
So far for my prototype I have been generating double sided polygons with 3-12 sides and attaching 3D versions of Rigidbody and freezing z and x + y rotations. Plus setting the inertial tensor to 1 and rotation to identity because the physics system cannot work out those values for a plane. As the mesh is so simple I've been reusing the generated shared mesh from the filter with a mesh collider.
I've been able to apply forces to the shapes to move them around, but the collision seems to be way off when testing - colliding way before the mesh - as if the collision mesh were bigger or translated? As it is being generated I'm not sure the best way of visualising it either.
I have seen other posts that suggest using bounds in update rather than physics in fixed update. I'd like to be able to "blow" things around so it would be nice to keep the physics. But for the game to be fun collision needs to be spot on or it will be really irritating.
Plus there is this new nice looking Unity 2d system - though does that assume all sprites are quads and then many colliders drawn over them? I could do that with my shapes, perhaps even generate many colliders for my generated polygons... but that seems wasteful as the meshes are so simple anyway. Also examples for this new system seem understandably a little thin on the ground.
This project is a bit of a Unity learning experience for me so I'm happy to try out any approaches that you Unity experts think is best.
Your answer
Follow this Question
Related Questions
Having an array of points(vector2), how do I create a 2d terrain? (new to unity) 2 Answers
Generate collision mesh from 2d texture? 0 Answers
2D Procedural Voxel Collision, how? 2 Answers
minimize vertex artifacting for procedural mesh manipulations - vertex collision same object? 0 Answers
Convex Mesh Collider on Procedurally generated mesh does not conform.. 2 Answers