No announcement yet.

Having Trouble setting up AI that doesn't use the Character Class/Capsule Component.

  • Filter
  • Time
  • Show
Clear All
new posts

    Having Trouble setting up AI that doesn't use the Character Class/Capsule Component.

    I can't find tutorials that explain how to set up essentially a replacement for the Character Movement component that can be used on a regular pawn class (Since Character class has it's root component locked as the capsule component which cannot be used with my Flying AI because when I come up below my AI they detect me before I actually touch their capsule component ruining their movement and combat behavior).

    Since most AI in games are ground characters this isn't particularly an issue for most people, but for my 2d bird game that involves spore-like combat (Running into the birds) the wonky behaviors of the capsule component is a major issue.

    To help you visualize imagine 2 2d birds, one the player and the other attacking the player from directly above - AI moves to player who is sitting still(on the ground for example), the AI using the Capsule component suddenly stops before it hits the player because the movement node in the BT is finishing as if it's reached it's target despite there being zero visible collision between the 2 actors based on enabling visibility on the capsule components and any other volumes on the player or AI.

    The immediate solution to this problem is to shrink the capsule component and use another volume to handle collision which kinda works, it solves the AI's problem but it isn't a solution since apparently only the root component can have collision enabled. I can fire events based on the new sphere volume, but there is no actual
    collision to block the ground or other birds as only the capsule component can do that.
    Since the root component of the character class cannot be changed, I have to use a pawn class but I haven't been able to find any tutorials on creating the movement controls for a pawn, similar to what the movement component does for the character class so I'm stuck on this.

    TL;DR: I need help figuring out how to replicate the functionality of the character movement component's flying controls for a pawn and have that interface well with the rest of my system IE the controller and BT. I would hope to be able to do this 100% in blueprint but C++ isn't completely off the table as I have dabbled with it before. If you know of any tutorials please link them and if you have any advice at all I would love to hear it. - DON'T be afraid to ask me questions or for more information!
    I appreciate anyone in advance who is willing to take the time out of their day to help my team and I out thank you. PS: If someone requests it I'll try and upload a video demonstrating exactly what I'm talking about.
    Last edited by Soviet03; 08-10-2017, 05:53 PM.

    Well I was able to replace my Original pawn with one that uses the Floating Pawn movement component But I discovered after a days of work that the issue with my previous Pawn wasn't the Capsule component after all (Instead it was the movement task in the BT, no matter what I did it would reach it's target before any collision takes place from a 90* downward angle, So I made a custom movement task that simply moves the AI toward the player without any other information and no internal way to stop it's self), but I figured I'd go with my new pawn anyway until I discovered an issue with the Floating Pawn Movement Component, even if I set the velocity to zero and read it out in real time the pawn would still move like it had momentum despite print screen telling me that the Pawn's velocity is 0 0 0.

    Obviously that's yet another bug I discovered.

    So using my new movement task I can use my Original pawn that uses the Character class with the character movement component and everything is working now.


    1. Conventional move to tasks that use the "AI move to" or "move to" nodes do not play well with verticality. When I have the time I'll file a bug report for this.

    2. When using the Floating Pawn Movement Component setting the velocity to 0 0 0 doesn't actually stop the pawn in the world, it carries on even though it's velocity is apparently 0 0 0. You can stop this by setting the deceleration to something crazy but then your AI will either instantaneously accelerate or stop instantaneously and adding any kind of impulse won't work what so ever. You will only be able to add movement commands. Obviously this is a bug because I can't imagine in what world a pawn tells you it has a velocity of 0 0 0 but continues to glide with it's own momentum. Will come up with a bug report when I have the time.