Alright so I am trying to make a script that knows when the player is moving and what speed they’re moving with.
Below is the script that would do that, but it outputs "“Changed is not a valid member of Vector3"”.
Now I kind of understand why the error happens, however I have no idea what to do about it.
local char = script.Parent
local vel = char:WaitForChild("HumanoidRootPart").AssemblyLinearVelocity
vel.Changed:Connect(function(vel)
print(vel.X)
end)
That’s quite bizarre. It may be due to the custom character. Does the server see the character moving about? (and does the client see it moving about?). If it is shown as moving about it should definitely be updating the properties
both the client and server show the same movement, and both are stuck… I followed a turtorial on rigging and the joints should be correct (humanoidrootpart → torso)
ok it actually does change the properties on the server when I move the character with my mouse.
So it registrers the player’s visual position from the client, but not the property.
The character properties do move on client on my main pc. Maybe the other one had network issues or soemthing. Either way the issue must still be this. It just doesn’t trigger at all. Are you sure that humanoidrootpart:GetPropertySignal is a real thing?
Says that only RunService is used for variables changed by physics. I honestly didn’t know RunService allowed for other things to happen in a script. That makes it a lot easier… hopefully.
Thanks for your time anyway.
Then check with .Heartbeat or .RenderStepped manually instead of relying on events (since they wont fire). Also they probably mean :GetPropertyChangedSignal() that detects certain properties changing.
local hrp = char:WaitForChild('HumanoidRootPart')
local oldVelocity = hrp.AssemblyLinearVelocity
game:GetService('RunService').Heartbeat:Connect(function()
local velocity = hrp.AssemblyLinearVelocity
if oldVelocity ~= velocity then
-- changed
oldVelocity = velocity
end
end)
RunService.Stepped:Connect(function()
if char.HumanoidRootPart.AssemblyLinearVelocity.Magnitude < ? then
if walkAnimTrack.IsPlaying then
walkAnimTrack:Stop()
end
end
end)
works, even though this gives another issue related to my UIS script. But that is unrelated to this post I guess. Should be able to figure it out.