Hello, I would like to create a head bobble effect with C++.

Well then you already have your character reference. From there you can just get the Character Movement Component and get the velocity from that.