2D Path Following Physics (Velocity) Based?

I have seen a couple of topics talking about but I was wondering if the ability to use AILerp with Rigidbody2D was in the package yet? Right now I do a knockback against enemies with AddForce, so I would like to use Rigibody 2D velocity to move the enemies objects.
I tried modifying the AI Lerp to take the direction in the update function and uses that to set the velocity but it is going in the wrong direction then.

Any help would be appreciated!

Travis

Hi

The AILerp script is designed to follow the path exactly by simply interpolating along it. Physics of any sort does not make sense to use with it.
Maybe you want to use the AIPath movement script instead? That has out of the box support for rigidbodies.
See https://www.youtube.com/watch?v=i1Lo_WI_YOQ (second half of the tutorial)

Thanks very much that has put me on the right path, ha.
The new issue I have encountered is that my 2D object does not need to rotate at all.
I just want it to move towards the target not have to “face” it. I have set the rotation speed to 0, but that just makes it not move at all. Is there a setting or area of code in AIPath to modify?

Thanks!
Travis

Hi

Try setting rotation speed to 0 and the slowWhenNotFacingTarget setting to false.

I do not see an option for slowWhenNotFacingTarget in 4.10 Pro Version of AIPath

Thanks
Travis

Ah. Right. That might only exist in the beta.

Try to open the AIPath.cs script and find the call to MovementUtilities.ClampVelocity. The 4th parameter should be a ‘true’ boolean I think. Change that to ‘false’.

That worked great, thanks!

Travis