So I'm trying to make an effect similar to the inverse of those metal pin toys where you put your hand in and then it pops out on the other side. So I want to take a model and dynamically have it imprint this array of rectangles. I'm currently using a shrinkwrap modifier on it set to a negative project. But I'm running into some issues that I'm not sure how to solve. For instance, once my cutout model goes beyond half of it's height down, then the shrinkwrapped vertices decide they want to project on the top faces of the mesh, not the bottom. Also I want the faces remain horizontal. So right now if only 1-2 vertices are being projected, the remaining ones will sit where they are.
Shrinkwrap only calculates based on the current frame so you just need to make your collider very very tall to avoid popping out. You can always use a custom hidden collider object that is parented to the actual object that you want to show.
In order to make the whole pins move, I would put the shrinkwrap modifier on a simple grid, and use vertex instancing to add the pins.
- Create a grid with one vertex per pin, placed in the center of where the pin should be
- Create a single pin model
- Instance the pin model on the grid's vertices, and make sure it aligns correctly. Don't use the align on normals option, because shrinkwrapping may change normals, causing twisting etc.
- test colliding with the grid using shrinkwrap