Announcement

Collapse
No announcement yet.

Decals spawning help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Decals spawning help

    Hi I'm trying to implement a system which spawns blood decal (on the hit surface) when a ragdoll impacts with something but using Event Hit or On Component Hit gives me a lot of calls (one for every bone that generates hit events) so for a single impact at least 5-6 blood decals are spawned and this is pretty disgusting.Right now I disabled hit events on almost every bones ( to reduce the number of spawned decals) excluding pelvis and head but my system is far from being perfect. What's the best way to deal with that? Is there a good way to implement something like this? Also remember that I need to calculate the correct rotation of the decal depending from hit surface inclination (for example a wall or a floor), to do this I'm using the hit surface normal but If you advice something better than Event Hit I would also like to know how to calculate the correct rotation.

    Thanks in advance

    #2
    For the rotation, you would do something kind of like this:

    Comment


      #3
      thanks for your answer. Yes I know I need to use the Normal but If I use Overlap Event I don't know how to calculate it, If I use Hit Event I have the normal to calculate the decal rotation but then there's still the problem that a lot of calls to the Event are made and so a lot of decals are spawned (basically one for every bone hit).The perfect solution would be to know how to calculate the Hit Normal (like the one present in the Event Hit Node) from an overlap event so that I could use that calculated normal to place correctly my decals.

      Comment


        #4
        Why don't you just add a boolean at the beginning such as

        If Bool RecentlyMadeBloodSplatter True do nothing, If False MakeBloodSplatter -> set RecentlyMadeBloodSplatter to True -> Delay 0.5 seconds -> set RecentlyMadeBloodSplatter to False.

        This way, it'll only get called once then shut off until the delay from the first and only time it ran completes, resetting the bool so it can run again. So end result only one blood splatter decal will be made on an impact with 0.5 seconds inbetween the next possible impact (you can raise or lower delay as you see fit), and you won't have to filter out/ignore any bones. If you wanted more than one blood splatter per impact, you can just expand it to include a counter of times ran within a certain interval before Setting RecentlyMadeBloodSplatter to True / resetting.
        Last edited by Deathstick; 05-30-2017, 03:05 PM.
        Indie Dev - Whiskey Cat Softworks
        Currently developing a colony survival game!

        https://twitter.com/WSoftworks https://www.facebook.com/WhiskeyCatSoftworks/

        Comment


          #5
          well thanks for your effort but it keeps spawning 5-6 decals per hit. I placed a check for the boolean just after the OnComponentHit node and after spawning the blood I set the bool false (with a 0,5 delay) after setting it to true. I don't really know wtf is happening here at this point... Event Hit is basically useless if it just spams dozens of event reports for just a single skeletal mesh

          Comment


            #6
            Let's see your current Blueprint.

            Comment


              #7
              Well I remade my code and now it works perfectly.I'm using physics linear velocity node to check if the ragdoll is impacting hard or not against something so when it moves fast it will leave around a lot of blood even if it touches a wall with his pinky so I'm asking myself If there is a better way to check an impact maybe with some vector magic or things like that xD.
              Anyway If someone as sick as me a day of these will try to make something like this I hope he/she will find useful my simple BP.

              In the second pic I moved the "OnComponentHit" node to let you see where you need to link the nodes.

              Here you are:
              Click image for larger version

Name:	Immagine1.png
Views:	1
Size:	94.4 KB
ID:	1128955



              Click image for larger version

Name:	Immagine2.png
Views:	1
Size:	164.8 KB
ID:	1128956

              Comment

              Working...
              X