A* Pathfinding Project

Character bounces off things as it paths


#1

I’ve been googling and trying random things. Adding physics materials and such but I cannot figure out what is causing it and how to make it stop.

My Player bounces off the collision walls as it is walking to its target


#2

Hi

It looks like the ‘acceleration’ setting on the movement script script might be too low?


#3

That seemed to fix it but I don’t understand as to why? I changed it from Default to 10,000 and that smoothed it out to a reasonable level


#4

With the change it looks more like this.


#5

Hi

What happened before was that the character was slightly below the path, so it moved upwards. When it reached the path it would normally start to move straight but due to its low acceleration it continued to move upwards for a small duration of time. This oscillation looked a bit like bouncing.

Considering your game, you might want to use the AILerp movement script instead? That follows the path exactly. You might want to add a SimpleSmoothModifier though.


#6

I’ll take a look into AILerp. I was using the documentatin for 2d pathfinding to get to where I am now and even it seems out of date.

Thank you for your help and your awesome pathfinding tool. I was definitely dreading having to write my own. Definitely worth the $$


#7

Hi

Was there anything in particular that stood out? The video is a bit outdated true. But I think the text should be up to date?


#8

It says to use Ray as the collider type, there is no such thing anymore. It also later shows using sphere… which also doesn’t exist… so I ended up using circle.

I think that was the only thing that was completely different. The rest was pretty accurate. I will admit I watched the video on youtube before even going to your documentation site.


#9

Hi

Ah. Good catch. The Ray mode in 3D corresponds to a Point in 2D. Capsule corresponds to a Circle. They were renamed for 2D some time ago.