Blueprint Issue with Set Actor Rotation

Hello everyone, I am having a small issue with getting my actor to rotate to face my character at all times. The actor contains a directional light in which rotates its Z axis depending where the location of my character is. However, after checking and testing for a while I keep running into a blueprint issue which the Z axis does not move at all. The only thing that happens is that the Z axis goes from it’s initial -165 degrees to 0 when I started running the game

I notice your Z clamp node has 360 as max. Could it be interpreting that as being the same as 0?

Actually, come to think of it, you could test just the rotation node. Try plugging in the result of the Find Look At Rotation directly into the set rotation. Does that node alone not act as expected? Then we would at least know if it is just something with the clamps causing the issue or not.

As Detach789 speculates, the problem is with your ClampAngle parameters. It doesn’t seem like this should cause this bug. But what you defined is a range larger than 360.

360 degrees is also 0 degrees. So your range is -165 to 0

The ClampAngle code picks the nearest boundary to snap to.

Other ways you could write this to be correctly specific. Both of these will give you the same result, because they define the same range.

Bring the min up a twist:

  • Min Angle Degrees = 195
  • Max Angle Degrees = 360

Bring the max down a twist:

  • Min Angle Degrees = -165
  • Max Angle Degrees = 0

I have tried plugging the node directly and it works it’s just not what I am looking for. I have provided an image showing what I am trying to do but I’m still having trouble with it. Basically The directional lighting object is placed in the center of the map so I will need to restrict the z axis from rotating fully.


Okay, so if the Look At Rotation node is working properly, then we can conclude it is something with the clamps. :slight_smile:

The poster BenVlodgi seems to have explained the issue really well in another answer, so I’ll just let you read that version.