Hello,
I want recreate project on UE4 from Unity. In example project character move to point and rotate to move direction. I want it rotate and move only forward direction and not have problem with physics and not stuck on obstacles. Surf goolge and forum did not bring the results.
Just to clarify you don’t want the character to walk backwards for example? You want to avoid these kind of thigs and have the character to always walk forward, right?
I saw that topic and based on my experience, I am afraid that the character will be hit into obstacles because character path always calculated for current point to end point. But character movement vector not equal to current path segment vector. Thanks for the quick response, I will try this in any way.
Take a loot at the SetFocus/SetFocalPoint function of AI_Controller. This functions specifies at which object does the character looks (or location) when moving. It has different priorities. I think it is what are you looking for and it is far easy.
The path that the character follows is the same, the only thing that it changes is the rotation of the characther (the direction that is facing). It has multiple priorities, the character can move to a point always facing that point, even if they are obstacles; or it can focus middle points moving towards the final destination (as humans do).
I did it by having my AIController class override UpdateControlRotation to turn slowly towards the next focal point (GetFocalPoint). I then set the character walk/run speed to zero in the character movement settings, and updated the character location manually by something like NewPos = OldPos + (MyMoveSp * DeltaTime * GetActorForwardVector());
As you can imagine, the character didn’t stay exactly on the nav path, but it wasn’t a big deal in my case. There is no navigation function in Unreal that does exactly what you want (a nav path with tangents that take into account rotation speeds). If you want one, you’d have to write it and hopefully share it with the rest of us
In a case such as you showed, Epic would prefer you add a turn around animation that gets the player pointed in the right direction, and then navigate as normal.