Download

Help Me With - Actor is Not Rotating

I have a light reference in my script that tells the actor to rotate when a valid reference is set, except it’s not rotating, regardless if set or not.
I have an arrow component variable that is attached to the root, that represents the facing direction of that light, and that does rotate. They both use the same rotation values. So why does the arrow rotate but not the light actor?

lightActor->SetActorRotation(FRotator(lightCurrentPitch, switchOnYaw(), 0));
lightFacingDirection->SetRelativeRotation(FRotator(lightCurrentPitch, switchOnYaw(), 0));

rotating_sun

it says it’s rotating…

With the info you are giving, only thing that come to my mind is:

  • Is the light set to movable?
  • Another thing is the difference between SetActorRotation and SetRelativeRotation, SetActorRotation moves the root of the blueeprint and all the childs follow it. Maybe you are trying to rotate the actor to a direction is already facing and the arrow as a child, then you are adding X rotation extra to the arrow relative to the actor rotation.

Example, Light and Arrow are facing to 90 degrees. You are telling the actor to face 90 degrees so it doesn’t move at all because is already facing that direction, but you are adding 90 degrees extra to the arrow, since the rotation of the arrow is relative to the root component of the blueprint. That could explain why the light doesn’t move, but the arrow does.

The Actor I am trying to rotate is not the same as the the one that tells it to rotate.
Think of the c++ class as a “Light Manager” that has a public variable for light Actor that is set by me or another user in the BP child of this class. NO WHERE in my script is the reference set, it only checks for validity that the object was set in the BP. All conditions are passed, yet the light actor, not my BP, does not rotate, but the arrow does.