Unity 3D: Warthog Physics attempt #3

Опубликовано: 17 Июнь 2026
на канале: Why485
2,079
105

When I played Halo CE a few days ago I noticed some interesting things about the Warthog's physics that got me down a Warthog physics rabbit hole again. This isn't the first time I've tried to simulate a Warthog, but this is the first time I wrote the physics myself versus just using the built in Unity PhysX wheel colliders, and the first time I've tried to animate the suspension.

I know the Halo CE physics are all based on spheres, so I wanted to do something similar. I'm still not exactly sure how/why the Halo physics work, especially with how they handle collisions, but this definitely feels a lot closer to the CE Warthog than my last attempt. I'm pretty happy with the way the physics came out.

Unfortunately where I really struggled was the visuals. I'm not convinced that the visuals for the wheel suspension have anything to do with the actual physics. I think they run their own separate calculations to just follow the ground on their own so that they just appear to match whatever is going on under the hood. Either way, I wasn't able to get the suspension looking perfect. It kinda works, but it's a bit janky so sometimes the wheels don't appear to touch the ground correctly or clip into it.

I think some of this might be because the way I coded the suspension arm, there isn't really a linear relationship between the angle of the suspension arm and how much travel the wheels have, despite the code assuming there is. It'll be correct at the extremes, but everything in between might be slightly off.