|
It looks like you're making a collision normal vector from the difference between the object center and the player center. This is going to mean collisions act differently near the corner of a polygon vs near the center. That's not right. It should act the same anywhere you hit the same polygon. So you might want to instead use something like the normal of the surface that was hit.
Also it looks like you're moving the player back to a last-known-good position on collision. For more fluid movement you usually want to do something like truncate the movement vector so that you "slide along" the wall with the component of the velocity in that direction. Different games handle this differently but usually it's something that fits that description. For example in Portal 2 I noticed you get a speed boost from this, which is weird. I think it's overcompensating truncating your velocity and then accidentally giving you a boost along the wall.
Point is, even Valve doesn't get it right apparently, so don't sweat it too much.
|
|
|
|
≡
|
2023 Jul 31 at 03:44 UTC
|
|