cybers2001 Posted December 7, 2025 Share Posted December 7, 2025 I am working on a server mod that can issue WalkTo commands to players. It works fine without predictive mode, but with it, the player slides and is uninterruptible. This is my logic: GLOBAL.STRINGS.ACTIONS.ACTIVATE.FOLLOW = "Follow" local function OnActivate(inst, doer) local pos = inst:GetPosition() local delta = GLOBAL.Vector3(20, 0, 0) doer:DoTaskInTime(1, function() local action = GLOBAL.BufferedAction(doer, nil, GLOBAL.ACTIONS.WALKTO, nil, pos + delta, nil) doer.components.locomotor:PushAction(action, true) end) end AddPrefabPostInit("arrowsign_post", function(inst) inst:AddComponent("activatable") inst.components.activatable.OnActivate = OnActivate inst.components.activatable.quickaction = true inst.components.activatable.forcerightclickaction = true inst.components.activatable.inactive = true inst.GetActivateVerb = function(_inst) return "FOLLOW" end end) How do I avoid this issue? Link to comment https://forums.kleientertainment.com/forums/topic/168999-walkto-actions-with-predictivemode/ Share on other sites More sharing options...
cybers2001 Posted December 8, 2025 Author Share Posted December 8, 2025 (edited) Solved this! I took a different approach. Instead of controlling players strictly on the server side, I relayed to the client, and had the client perform the action. In a client component, I use this logic: if self.inst.components.locomotor then --lag compensation ON local action = BufferedAction(self.inst, nil, ACTIONS.WALKTO, nil, pos) self.inst.components.locomotor:PushAction(action, true) else --lag compensation OFF SendRPCToServer(RPC.LeftClick, ACTIONS.WALKTO.code, pos.x, pos.z) end This will work for both predictive mode on and off. Edited December 8, 2025 by cybers2001 Link to comment https://forums.kleientertainment.com/forums/topic/168999-walkto-actions-with-predictivemode/#findComment-1844950 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now