StoneThrow - Breakdown
Problem: To make a realistic visual effect for when the rock hits the wall with impact.
Answer:
For the Dust Particle Effect I am spawning in a couple of sprites with the dust material I made. The dust material is world aligned to give it a more realistic look. The dust also has UV distortion that is panned and rotated look to give the dust a natural look for when it is dispersing. The dust also has a radial gradient onto its opacity to give it a smooth fade across the sprite.
Problem: To be able to control the movement of the rock using magic, and have it follow the direction the camera is facing.
Answer:
For this event, once the player holds down the trigger a line trace is shot from there. If the obstacle that the line trace hits is a rock actor (checked by whether or not the actor has a specific tag), the find rock function is called with its custom functionality is called from the rock blueprint.
Problem: To send the rock into the wall with impact and have the rock destruct once it hits the wall.
Answer:
When the trigger is released, the grab component is released from the rock, and additional impulse is added onto the rock. Giving the force push effect onto the rock. The impulse is calculated using your camera direction. Once the Rock hits the wall the Dust particle is spawned in at the hit location and then activated. The Magic particles on the rock are then deactivated, and the magic on the material is then disabled.