Player Solidity

From Valve Developer Community
Jump to: navigation, search
Wikipedia - Letter.png
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
Dead End - Icon.png
This article has no links to other VDC articles. Please help improve this article by adding links that are relevant to the context within the existing text.
January 2024


Player collisions aren't that simple because there are multiple systems for them.

There are three systems that interact with player collisions:

Gamemovement - the player sweeps a box through the world, hitting things that are solid. This is where the player's movement happens. If you want to modify which things impede the player's movement, you do it in gamemovement.

Player's solid flags / solid type / collision property - Other entities also sweep a box through the world like the player does. These flags determine whether the player is solid to them (along with those entities' trace filters and contents masks). This will determine whether NPCs bump into the player, etc.

Vphysics object - this is only used to control collisions between the player and entities that are MOVETYPE_VPHYSICS. In HL2 (this is not true for all of the multiplayer games, so it depends on which set of rules you are using) the player is represented by a separate physics object. After gamemovement determines where the player would like to go the physics simulator runs and tries to move this proxy/shadow object to that location. If it succeeds then nothing changes. Otherwise if it hits some simulated object along the way the player code may decide to to the results of the physics simulation instead of gamemovement.

Information c/o Jay Stelly