How to get data from scriptable object on collision in Unity?

Hey, I have a scriptable object that only contains a float variable and I have assigned it to an object, lets call this object A.

I have another object we will call object B, and I want to make it so that when object B collides with object A it gets the data from the scriptable object in object A. I have set up the collision code and all I need to do now is make it so that I get the data from the specific object that I touched.

How do I do this, thanks!

Make a reference to the scriptable object in Object B, then pull from it.

For example

[SerializeField]
private (type) scriptableObjectName;

Drag the reference in editor

And then on collide, reference the variable via scriptableObjectName.(variablename)