Component hirerarchy problem

guys i have this arrow component in my character class which is just a point in space to do some mechanics, and I want this arrow to rotate where ever the camera is looking however I only want to rotate it in the z axis and the rest should state the same. so I added the arrow as a child of my camera so that it still follows the camera in all directions and I don’t know any way to prevent it from rotating in x and y-axis. does anyone have a solution?Annotation 2021-10-29 201057

I understand you want for the arrow to stay flat on the X / Y axis, and not look up or down.

You can try this: Get camera rotation → break rotator → make rotator only with Yaw → Set rotation to arrow every frame.

If that gives you problems, it’s probably because it’s a child of the camera, so you can also try:

  • Get camera’s forward vector
  • Find look at rotation:
    – Start = Get arrow world location XYZ
    – target = Get arrow world location XYZ + camera’s forward vector XY: you’ll need to break vector and leave out Z when adding the forward vector.
  • Set find look at rotation to arrow’s world rotation.

This way the arrow will point at an imaginary point in the XY plane that will always be in the direction the camera is looking.