Would anyone be able to help me doing this?
You want this tutorial here: Programming Quick Start | Unreal Engine Documentation
Instead of bobbing the vertical position of the cone, spawn a cube and rotate it instead. Once you start writing the code, intellisense will suggest the methods you can use. Rotational transformation will be one of them.
Thank you very much!