Inverting Float value for MetaSound synth frequency

Hello,

I’m still pretty new to unreal and am trying to work out how to invert the float values on a blueprint. I am basically trying to control the frequency of a filter when the player moves closer to it. Ideally I would like it to change to higher frequencies when moving close and lower as I move away, however, it is the opposite (lower when closer).

I am sure there is a better way to do this but at the moment I have a distance node comparing the blueprint actor to the player which then controls the the frequency of a meta sound parameter. Is there any method to inverting the float number to be the opposite?

Thank you so much in advance!

Hey there
You can just decide a fixed Max Distance and do Max Distance - Distance. Simple math way to invert numbers.
To avoid issues clamp your Distance just in case it exceeds your Max Distance.

1 Like

Thank you so much that works really well!

While I was waiting for the post to be approved I ended up coming up with a somewhat similar solution albeit a little more messy by using a map range node.

1 Like