Facepunch / garrysmod-requests

Feature requests for Garry's Mod
86 stars 24 forks source link

Add Entity:MakePhysicsShadowAnObject #2454

Open WinterPhoenix opened 2 months ago

WinterPhoenix commented 2 months ago

Details

We already have Entity:MakePhysicsObjectAShadow, but there's a need for an inverse version of it.

For example, in a custom player pickup system (like +use pickup), we want to be able to use MakePhysicsObjectAShadow on an entity on pickup, so we can use PhysObj:UpdateShadow to update the position and rotation while the player moves it around. Then, Entity:MakePhysicsShadowAnObject to restore the physics object's original properties once the player drops it.

Recreating the physics object is furthermore not an option since it breaks constraints.