User Tag List

Results 1 to 4 of 4

Thread: Apply damage to hit actor

  1. #1
    0

    Apply damage to hit actor

    Hey,

    im currently confused when it comes to apply damage to the actor my projectile hit.

    I know how to apply it to one enemy type, but if i will have multiple ones, i dont know how i would cast to the one my projectile hit.

    Im not making it to complex, means the only difference will be the health the enemys have.

    As you see im casting to the hit actor directly, but since i will have more then just 1 type of this class.

    So how would i need to do in this case :S ?

    Name:  1.png
Views: 40
Size:  344.4 KB


    Name:  2.png
Views: 40
Size:  550.5 KB

  2. #2
    0
    The way I did it is by creating one parent blueprint that holds all of the damage programming, and then creating children blueprints off of the parent. This way, they all inherit the damage function and you can "Cast To" the parent BP. As long as the attack is hitting a child of the parent, it will still be effected.

  3. #3
    0
    You could have a base class that has all the basic logic for taking damage, and all the other "enemy types" are children of this class.

    Or, and I would recommend this, you utilize interfaces.
    https://docs.unrealengine.com/latest...ace/index.html
    https://docs.unrealengine.com/latest...ces/index.html

    A third option is to use the built in damage system.
    Sadly there is little documentation about it, but it's actually pretty straight forward.
    https://docs.unrealengine.com/latest...age/index.html
    https://www.unrealengine.com/blog/damage-in-ue4
    https://www.youtube.com/watch?v=8RuMckVAA4c
    https://www.youtube.com/watch?v=MLtDgukVG94

  4. #4
    0
    Well, that apply damage ( built in one ) is currently the best option for me at the moment. I tried it once but now i actually know how to use it.
    So thank you both for the replys !! have a nice one

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •