Raised This Month: $ Target: $400
 0% 

Entity animation bugged frames.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-16-2021 , 18:00   Entity animation bugged frames.
Reply With Quote #1

I am trying to spawn an entity and play its animation to the end right when it spawns. What happens is that upon spawning, the animations starts playing up to certain frames, resets to the first frame then continues after a few moments. This could be best shown with a video example: https://youtu.be/XiXJi3-640o. You can clearly see how it is bugged out.

PHP Code:
public CmdCorpse(iPlayer) {
    
    new 
iOrigin[3], Float:fOrigin[3];
    
get_user_origin(iPlayeriOrigin2);
    
    
IVecFVec(iOriginfOrigin);
    
    new 
entCorpse create_entity("info_target");
    
    if (!
entCorpse) {
        
        
log_amx("Could not create custom corpse entity.");
        return 
FMRES_IGNORED;
    }
    
    
entity_set_string(entCorpseEV_SZ_classname"custom_corpse");
    
    
entity_set_model(entCorpse"models/player/terror/terror.mdl");
    
    
entity_set_int(entCorpseEV_INT_solidSOLID_TRIGGER);
    
entity_set_int(entCorpseEV_INT_movetypeMOVETYPE_TOSS);
    
    
fOrigin[2] += 50.0;
    
entity_set_origin(entCorpsefOrigin);
    new 
Float:maxs[3] = {16.016.036.0};
    new 
Float:mins[3] = {-16.0, -16.0, -36.0};
    
entity_set_size(entCorpseminsmaxs);
    
    
entity_set_int(entCorpseEV_INT_sequence107);
    
entity_set_float(entCorpseEV_FL_frame1.0);
    
entity_set_float(entCorpseEV_FL_animtimeget_gametime());
    
entity_set_float(entCorpseEV_FL_framerate1.0);

    return 
FMRES_IGNORED;

This code is how I managed to spawn an entity and set its animation. Suggestions for better methods (that work, obviously) are open!

I don't know what animtime does actually, but setting it to 100.0 like seen in many threads related to animations delays the animation for a few seconds. Clueless.
redivcram is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode