• GM:CalcMainActivity not applying animations to model
    2 replies, posted
I am working in a gamemode trying to set up working animations when the player's model is set to a HL2 NPC character (Clockwork / Nutscript / etc do this). function GM:CalcMainActivity(ply, veloc) local plymodel = ply:GetModel() --print(plymodel); --print(modelgroups["models/Humans/Group01/male_09.mdl"]); --print( veloc:Length2D() ); -- local model_animtable = modelgroups[plymodel] -- this will return us ex: citizen_male_anims act = "idle"; if ( veloc:Length2D() >= 190 ) then act = "run" elseif ( veloc:Length2D() >= 1 ) then act = "walk" end act = modelgroups["models/Humans/Group01/male_09.mdl"]["normal"][act][1]; ply.CalcIdeal = act or ACT_IDLE ply.CalcSeqOverride = -1 print(act); return ply.CalcIdeal, ply.CalcSeqOverride or -1 end I have verified that 'act' is in fact working, when I print it to console I see it's putting out numbers like 1 and 6 etc correctly (ACT_IDLE and ACT_WALK, but im not sure what exact sequences these acts are tied to). Anyways, the model just keeps t-posing when I go thirdperson via console. It doesn't show any idle or walk animations. The base gamemode CalcMainActivity IS being called (I tested this by putting a print statement there) but I believe this one overrides it because it's in my actual gamemode, right? What could be going on here?
is this running on the client, server, or shared? "This hook must return the same values at the same time on both, client and server. On client for players to see the animations, on server for hit detection to work properly."
I've just got it in a file called animations.lua, and I haven't done if SERVER then / if CLIENT then or anything like that, so I assume it automatically runs shared. (Let me know if incorrect).
Sorry, you need to Log In to post a reply to this thread.