I have two characters standing on platforms and throwing projectiles at each other.
I’m setting up a AI character: I basically need it to move sideways on the platform according to the location of the projectile in order to get it or to block it.
I’m stuck in the part where I need to translate the location of the projectile and turn it into proper coordinates for my character to strafe to.
The character won’t move to the location.
I’m feeding to the node the projectile’s transform and the character’s location and it doesn’t move even switching them.
Weirdly if I use the projectile’s location the character moves only when they are lined up…
These are my baby steps in the AI territory, I’m still learning the basics here.
I think I’ve figured it out how to get the desired location for the pawn.
I just get the projectile’s location then multiply it by the character’s right vector in order to get only the lateral position.
Then get character’s forward and up vector and multiply them by its location and then finally sum them all up.
It works in the sense that the destination location is exactly what it should be BUT the character still won’t move to that location, when I feed it the projectile’s location it moves only when they are lined up laterally…
The character is standing on a platform surrounded by a navigation mesh, when I feed to the Service rando locations it works just fine.
These are the BPs:
Character’s (note that ATM I’m testing only with one Projectile):
I think I’ve sorted it out.
I got the offset between the character’s location and the projectile’s one, multiplied by the character’s right vector, then added it to the character’s location.
Just updating this thread with the solution someone suggested on another forum.
The solution was to use the Vector-plane node to determine the destination location of the pawn by feeding it the direction vector and the location of the pawn