• How to use prediction for this?
    4 replies, posted
[URL="https://github.com/Mysterypancake1/death-animation/blob/master/lua/autorun/server/sv_deathanimation.lua#L131-L135"]I have some code[/URL] that does the following: [B]1. [/B]Spawns a base_gmodentity, and makes it play a sequence. [B]2. [/B]Spawns a ragdoll. [B]3. [/B]Uses the base_gmodentity's Think function to move the ragdoll's physics bones to match the base_gmodentity's bones. (I can't use bonemerging for this because ragdolls can't be bonemerged to animated entities) This is meant to give the appearance of the ragdoll being animated and playing a sequence, when really the base_gmodentity is playing the sequence. I could just use the base_gmodentity to play the sequence and then spawn the ragdoll after the sequence has finished, but I want to use the ragdoll, because the base_gmodentity doesn't work well with other addons that use a ragdoll for certain stuff. [U]So, my question is this:[/U] How would I use prediction with the ragdoll so clients with slow internet won't see a laggy ragdoll animation? I thought about networking the base_gmodentity and somehow using that clientside to set the ragdoll's bone positions, but I'm not sure how. Any help would be appreciated!
Networking it yourself won't be any faster; it's already networked in the engine by default. Also, why not just use Source's FollowEntity? It sets the move parent and bone merges it.
[QUOTE=code_gs;50547357]Networking it yourself won't be any faster; it's already networked in the engine by default. Also, why not just use Source's FollowEntity? It sets the move parent and bone merges it.[/QUOTE] Yeah, but wouldn't it be faster to simply network the moving base_gmodentity ONCE so the client could (somehow) set the bone positions on their side rather than networking SetPos and SetAngles to the client TONS OF TIMES from the server? Also, I don't think FollowEntity would work, considering [URL="https://facepunch.com/showthread.php?t=1516664&p=50542002&viewfull=1#post50542002"]bonemerging doesn't work for ragdolls and animated entities[/URL]. I'll try it a bit later though.
You mean networking the entity? Sure, if you have a way of predicting the position and angles on the client as well. But you can bonemerge server entities iirc. That's how weapons work.
:snip: stupid post
Sorry, you need to Log In to post a reply to this thread.