LinearVelocity Visible Property not working?

I want to be able to see my LinearVelocity using the “Visible” property, but nothing is appearing or showing up in studio. I have tested it out on both Client and Server. I am wondering if the property is broken or I am doing something wrong. I have no errors in the output either.

image

My script:

local LinearVelocity = Instance.new("LinearVelocity")
LinearVelocity.Attachment0 = TargetHumanoidRootPart.RootAttachment
LinearVelocity.MaxForce = 100000
LinearVelocity.VectorVelocity = data.KnockbackVelocity
				
LinearVelocity.Color = BrickColor.random()
LinearVelocity.Visible = true
				
LinearVelocity.Parent = TargetHumanoidRootPart
LinearVelocity.Enabled = true
				
task.wait(.1)
				
LinearVelocity.Enabled = false
LinearVelocity:Destroy()

Do you have it selected while testing in Studio?
I’m pretty sure I was looking at a VectorForce during testing and had to select it to see the arrow.

Nothing changes when I have the LinearVelocity selected.

the visible property of linearvelocity doesn’t actually show anything visible in the scene itself it only controls whether the linearvelocity appears in the props window in studio
however as a workaround Instead try to make a part to represent the direction

local visualPart = Instance.new("Part")
visualPart.Size = Vector3.new(0.2, 0.2, 5)  -- Length represents velocity magnitude here tho
visualPart.Anchored = true
visualPart.CanCollide = false
visualPart.Color = LinearVelocity.Color.Color
visualPart.Transparency = 0.5
visualPart.Parent = workspace

RunService.Heartbeat:Connect(function()
    if LinearVelocity.Enabled then
        visualPart.CFrame = CFrame.new(TargetHumanoidRootPart.Position, TargetHumanoidRootPart.Position + LinearVelocity.VectorVelocity)
    else
        visualPart.CFrame = CFrame.new(0, -10, 0)  
    end
end)

Oh, I see. Thank you for explaining. The documentation on the property was pretty lacking.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.