Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GetPropertyChangedSignal("Position") will not detect position change via BodyVelocity?

Asked by 6 years ago
Edited 6 years ago

Here is the script I was using to test GetPropertyChagnedSignal:

local part = Instance.new("Part")
part.Parent = game.Workspace

local Velo = Instance.new("BodyVelocity")
Velo.Parent = part
Velo.Velocity = Vector3.new(0,2,0)

function CheckPositionChange()
    print("position changed")
end
part:GetPropertyChangedSignal("Position"):connect(CheckPositionChange)

I would think that the CheckPositionChange function would fire as the body velocity is causing the part's position to change, but I am not getting any output. However, when I change the part's position by going into the properties tab, it does fire.

Am I missing something here? Any help would be appreciated.

0
Seeing that the position property would change every physics update, i'd suggest to just use RunService.Stepped:Connect(function) RubenKan 3615 — 6y

Answer this question