SetOrigin'ing an actor to the player with net prediction?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Nash
 
 
Posts: 17283
Joined: Mon Oct 27, 2003 12:07 am
Twitch ID: nashmuhandes
Github ID: nashmuhandes
Location: Kuala Lumpur, Malaysia

SetOrigin'ing an actor to the player with net prediction?

Post by Nash »



I've got this actor attached to the player that's supposed to represent his legs in first person view.

Its position is actually updated from the PlayerPawn's PlayerThink itself. It's just a SetOrigin(PlayerPos, true). Works seamlessly in single player.

But in multiplayer, it appears that the leg actor is lagging far behind the player's position. Is there any way to make the positioning work seamlessly with the movement prediction? I've tried moving the position updater code to several different locations in PlayerThink (and yes, inside and outside of CF_PREDICTING; tried both)... but nothing seems to be working.
User avatar
Caligari87
User Accounts Assistant
Posts: 5994
Joined: Thu Feb 26, 2004 3:02 pm
Discord: Caligari87#3089
Github ID: caligari87
Preferred Pronouns: He/Him

Re: SetOrigin'ing an actor to the player with net prediction

Post by Caligari87 »

Nash wrote:(and yes, inside and outside of CF_PREDICTING; tried both)...
Just to clarify, but when you say "both" do you mean either/or? Try having the update code duplicate called inside and outside of a CF_PREDICTING check, if you haven't. I was having a hell of a time troubleshooting a similar issue with HUD interpolation and either inside or outside of a predicting check would fail in similar ways, but having the check in both places worked as intended.

Return to “Scripting”