Skip to content

How do I use mp.unobserve_property ? #16374

Closed Answered by avih
Rabcor asked this question in Q&A
May 25, 2025 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Please read the docs before trying random things.

It takes a function reference - not a property name. So you should make it a normal local function (and not a lambda function) and then observe or unobserve that function name.

like this:

local function my_func(...)
    ...
end

mp.observe_property("some-property", "some-type", my_func)
mp.unobserve_property(my_func)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Rabcor
Comment options

@avih
Comment options

avih May 25, 2025
Collaborator

@Rabcor
Comment options

Answer selected by Rabcor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants