View Single Post
Author Message
Bakuryu
Member
Join Date: Dec 2011
Old 09-25-2016 , 19:26   [CS:GO] Animating a player model entity
Reply With Quote #1

I was able to spawn a player model as an prop_dynamic, but I cannot get it to animated using

Code:
    SetVariantString("testWalkN");
    AcceptEntityInput(EntIndex , "SetAnimation", -1, -1, 0);
Here is the full script (minus the on start)

Code:
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
    char model[128];
    GetClientModel(1, model, 128);
    
    int EntIndex = CreateEntityByName("prop_dynamic");
    SetEntityModel(EntIndex,model);
    DispatchSpawn(EntIndex);
    SetVariantString("testWalkN");
    AcceptEntityInput(EntIndex , "SetAnimation", -1, -1, 0); 
    
    float hOrigin[3];
    GetClientAbsOrigin(1, hOrigin);
    TeleportEntity(EntIndex, hOrigin, NULL_VECTOR, NULL_VECTOR);  
    PrintToChatAll(model);
}
The model shows up, but it doesn't move. If I use ent_fire on it in game it also doesn't work, although if I set it to ragdoll it does lay flat instead of being in the default position.
Bakuryu is offline