Support Forum

Question about rigidbody 2d

Hi I have a question about using rigidbody 2d add force with AILerp.

How do I use AILerp with rigid body 2d?

I have tried to use GetComponent().velocity for my addforce,

but when I do that, it seems like my character is moving with velocity and transform position which makes it to move weirdly. Please advise on how to use just addforce with AILerp.

Additional question, I just purchased the pro versions, what are the features that I can utilize with 2d that are suitable for 2d?

Hi

AILerp is fundamentally incompatible with AddForce. AILerp follows the path exactly by setting its position to a point on the path based on the current time. It cannot do any kind of physics. See Movement scripts - A* Pathfinding Project

Grid graphs together with the AIBase or AILerp scripts are what I would recommend for 2D games. Take a look at Pathfinding in 2D - A* Pathfinding Project