Hi everybody,
I’m trying to add a repulsive force to avoid collision between my AI agents. I have a static mesh in front of my AI character that computes the overlap with another character. If there is overlap, I change a variable in the controller to let it know about the overlaping, to make the calculations. Inside of a function in the controller, I’m making a test calculation to see if something happens, but I can’t change the velocity of the characater to apply this force.
I was searching how to change the velocity of the character using the computed force, but I didn’t find how to modify the velocity of the character.
Inside of CharacterMovementComponent I found that you can apply a force or an impulse, but as I’m trying to do it in the controller, when I get The Pawn I can’t not apply this force or impulse. I made a Cast of the pawn movement component to a character movement component and then I can access to the functions, but anything happens…
Actually I don’t know if I’m focusing the solution in the wright direction… Is the first time I work with Unreal Engine and I’m a little bit lost about how to work with it.
Thank you very much!