How can I set the correct rotation for bullet impacts?
Hey guys, I have a complete set of bullet impact effects and I have them working very well with a line trace. They always spawn when I shoot an object, However, sometimes the impacts will not appear correctly. Sometimes when I shoot an object, a wall for example, the particle effect will spawn out the other side of the wall that is facing away from me. And shooting boxes normally allows for 1 to 2 sides that allow for correct rotation of these effects, but the rest of the sides make the emitter spawn inward and the effect is lost within the cube. Is there a way to perhaps get the rotation of the face that I am shooting and always force the emitter to spawn correctly? Thanks a lot!
asked Mar 07 '16 at 02:06 PM in Blueprint Scripting
it depends on how you're creating your bullets. if you're using a line trace, then break the struct of the 'hit' value returned from the line trace, and you can use hit normal to build a rotator. if you're using projectiles that spawn and impact (for slower projectiles), you'll need to get hit event and break out the struct with the hit info for the hit normal. if you are spawning projectiles for a bullet, this might not be the best approach performance wise, but be sure to use continuous collision detection if you need to use this approach for whatever reason.
answered Mar 07 '16 at 03:25 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here