zUsername Posted March 7, 2016 Share Posted March 7, 2016 I've this code but it sometime work sometime not. Please help me. AddComponentPostInit("locomotor", function (self) self.timemoving = 0 local oldOnUpdate = self.OnUpdate self.OnUpdate = function(self, dt) oldOnUpdate(self, dt) local is_moving = self.inst.sg ~= nil and self.inst.sg:HasStateTag("moving") local is_running = self.inst.sg ~= nil and self.inst.sg:HasStateTag("running") if is_moving or is_running then self.timemoving = self.timemoving + dt else self.timemoving = 0 -- sometimes this code is not executed. end end end) Thanks you. Link to comment https://forums.kleientertainment.com/forums/topic/65183-help-checking-player-not-moving/ Share on other sites More sharing options...
Aquaterion Posted March 7, 2016 Share Posted March 7, 2016 I believe you can check via HasTag("idle") Link to comment https://forums.kleientertainment.com/forums/topic/65183-help-checking-player-not-moving/#findComment-730775 Share on other sites More sharing options...
zUsername Posted March 7, 2016 Author Share Posted March 7, 2016 5 hours ago, Aquaterion said: I believe you can check via HasTag("idle") Thanks you.Let me try. Link to comment https://forums.kleientertainment.com/forums/topic/65183-help-checking-player-not-moving/#findComment-730845 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