Dynamically Animating a "prop_physics" Model

I have a physics prop I created that players can pick up and move around. I want it to play an animation when the player presses E on it. Is this possible as a prop_physics?

One idea I thought of was making a “dummy” func_physbox out of a brush that is invisible for a collision model, parenting my (non solid) model to it as a prop_dynamic, and setting output of the func_physbox to control the animation on the prop_dynamic. But is there a way to natively do that with a prop_physics?

Well I ended up using a func_physbox with my model parented as a prop_dynamic and it seems to work pretty well.

Is there no way to do this with only a prop_physics though? The way I have it set up now seems a little “hacky” and expensive. Might be more of a mapping question at this point.

I never tested this, but from what I know, props can have animations, just make an animation, compile it as a “sequence” in the prop’s QC, and in game make a script for it, I won’t go into lua since I know fuck all, but I am sure it would need to be an entity if you want it to make do something as you pick it up, else you’d need a separate code for it, which would be easy and lightweight but it’s no fun.

You have to make the animation in a 3d modelling program…

prop_physics doesn’t support animations by itself

You’re right, by itself they don’t do anything, you need a trigger, that’s why they should be either:
A) Entities or
B) Use a tool, there’s a tool called “Prop animation tool” (around those lines) that can play animations of a prop, as a demonstration, I sawed this boat in half, and saw it’s QC, which is:


$modelname "props_combine/Combine_Dispenser.mdl"

$bodygroup "studio"
{
	studio "combine_dispenser_reference.smd"
}

$lod 25
{
	replacemodel "combine_dispenser_reference.smd" "combine_dispenser_body0_model0_lod1.smd"
}
$lod 45
{
	replacemodel "combine_dispenser_reference.smd" "combine_dispenser_body0_model0_lod2.smd"
}

$surfaceprop "default"

$contents "solid"

$cdmaterials "models\props_combine\\"

$attachment "Package_attachment" "Combine_Dispenser.Package_Attachment" 0 0 0 rotate -90 -90 0

$cbox 0 0 0 0 0 0

$bbox -30.057 -32.096 -22.455 9.338 34.867 60.647


$sequence "idle" {
	"combine_dispenser_anims\idle.smd"
	fadein 0.2
	fadeout 0.2
	fps 30
}

$sequence "dispense_package" {
	"combine_dispenser_anims\dispense_package.smd"
	fadein 0.2
	fadeout 0.2
	fps 30
}

If you make an animation, and put the sequence in the QC, you will be able to play it using LUA, and that’s mostly what he wanted to know.

So I would have to use a lua_run entity to trigger the prop_physics sequence? How would I go about doing that?

I’m not a lua coder, but I am sure there is something about that in the wikia.