“黑暗灵魂(Dark Souls)”瞄准系统|蓝图|第3部分(决赛)


快来了

Share:

23 Comments

Add yours
    • 2
      Adrian Lurendium

      As you can see there is a function GetAllActorsOfClass where you specify your target class. In our case it’s a Enemy_BP. You can choose a different that fits your needs. You can the wire out of the target class and promote it to variable and then you will be able to change it in your properties.
      If you have multiple enemy classes that that don’t have any parent class, you can create a Blueprint Interface (https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/index.html) and apply it in all of your enemy classes. Then in Character controller you can use GetAllActorsWithInterface.
      Another fast but dirty solution would be to call GetAllActorsOfClass with different target class and combine it to one array.

      • 4
        Lou

        Hi Adrian!
        I’ve nearly got this method working, although once I connect the master blueprint interface to the ForEachLoop, It won’t let me connect it to the distance from player check – because its target is the mainboss. Do you know how to allow this interface blueprint array connect to the nearest target and distance player check?
        Thank you for your time.

  1. 11
    Hasson

    Hey, I’m new to blueprints and this tutorial was extremely helpful, I managed to get everything working. I have a similar question to what someone asked before, how do I go about applying this to more than one enemy, as i will have more than one type in my game. I have read your previous response and tried to implement an interface but had problems connecting the loop array element to both the distance from player check function as well as the nearest target variable. i couldn’t work out where i was going wrong. I also tried the array method but that didn’t quite make sense to me i’m afraid. I would appreciate some help or feedback or even just a helpful screen shot so that i can figure out, where i am going wrong. Thanks in advance, apologies if this seems like a stupid question.

  2. 15
    youssef nasr

    Really Awesome Tutorial Man If you can help me out my character is using sword anim set pro the lock on system works but i need to make sure the character always faces the enemy any ideas how

  3. 16
    Lou

    Hey man,
    Many thanks for the tutorials, they are great. I have came across a small issue – I did this in an empty project and it works fine, but I’ve created it in my game too, and for some reason If I’m standing too close to the enemy and I press the target button for the first time, my camera faces in a complete oposite direction. I also get loads of errors at this point saying.. Accessed None ‘NearestTarget’ from node Return Node in graph change camera and player rotation when Target’ in blueprint warrior_BP (this is my main character)

    Please let me know if you have any idea’s and I’ll donate some extra monies. Many thanks,
    Lou

  4. 23
    GbFR

    hi super tutorial
    I have a bug when I have 2 AI on my card and I want to aim at one of them the system want to aim both at once my camera goes from one AI to another several times by second how can I fix that?
    thank you

+ Leave a Comment