Would anyone be able to help me doing this?
You want this tutorial here: https://docs.unrealengine.com/latest/INT/Programming/QuickStart/index.html
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!