Is it possible to alter physics entities while holding them with the
gravity gun? In my mod, when a player is holding an object, they can
press a button that changes the model of the object they're holding.
I've got it working using this:
// change the visual model
SetModel("path/to/new/model.mdl");
// reset the vphysics model, since the size of the object may have changed
VPhysicsDestroyObject();
solid_t tmpSolid;
PhysModelParseSolid(tmpSolid, this, GetModelIndex());
VPhysicsInitNormal(SOLID_VPHYSICS, 0, false, &tmpSolid);
It does indeed work, however when the VPhysics model is recreated,
although the player still appears to be holding the object, they're
not. As soon as they let go, the object is teleported back to lying on
the ground where the player was standing when they changed it.
Any way to fix this? Thanks.
--Bob
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders