I’m currently developing a movement system, It works fine for the most part, but inconsistently It seems to break (stop moving) and produce a
Failed to call message response callback function, has it been deleted?
error,
through testing I have found out that the message callback does go through as normal, but the actual movement velocity tends to get stuck between two values, this is a modified port of my player movement script, that uses action.value, which I modified to work with a single vector for direction,
any help
local target_speed = self.Velocity.x * MaxSpeed --MaxSpeed is 0
local speed_diff = target_speed - self.Velocity.x
local acceleration = vmath.vector3(0, Gravity, 0)
if speed_diff ~= 0 then
if speed_diff < 10 then
acceleration.x = -MoveAccel
else
acceleration.x = MoveAccel
end
end
local dv = acceleration * dt
if math.abs(dv.x) > math.abs(speed_diff) then
dv.x = speed_diff
end
local v0 = self.Velocity
self.Velocity = self.Velocity + dv
local dp = (v0 + self.Velocity) * dt * 0.5
go.set_position(go.get_position() + dp)
self.Correction = vmath.vector3()