Hey everyone I am fairly new to this site and Unity itself. I am making a small simple testing game that involves a snowman shooting ice balls at walls and having the ice ball break upon contact. Any ideas on how to do this? I already have the snow man shooting the ice balls at the walls, but when I shoot they just hit the wall and drop then disappear. I really want the ice ball to break. How can I do this? Any help is greatly appreciated. Thanks!
There are several ways you can do it. It really depends on your target platform as to how complex you can go. I deal with mobile, so I would probably approach something like this by:
- Begin fading the snowball out on contact
- Instantiate (through some kind of memory pool, I like Pool Manager 2) a texture animation or particle system.
- Briefly after contact, spawn a falling texture animation for the collapsed snow and leave it on the ground.
An alternative is to create a complex snowball mesh that can be broken into many pieces first. Each mesh used to create the entire snowball would need to be closed. You could apply velocity/position to the parent group of the mesh until it comes into contact, and then apply a random rotation to each piece of the mesh with a slight velocity away from the center of the snowball, and a downward velocity. I would still recommend performing some kind of particle system or texture animation when it makes contact to keep it from looking too crisp.