Local Rotation Around Custom Axis

So I’ve been trying for over a week to get this working and it just doesn’t. Probably because I don’t know what I’m doing. I have a plane which can fly in any direction and I have a child actor which I want to rotate around the up vector of the plane regardless of which direction I’m in. I thought add local rotation would do this, but it does not seem to work the way I want it to. At certain angles the object which is supposed to orbit just gets stuck in it’s own orbit.
Any help with this would be amazing.

][1]

What object does this blueprint belong to? Is it the player’s pawn or some other actor? The top half indicates that you’re trying to get the owner of this blueprint to look away from the player’s pawn. Is that correct?

It is actually making the object shown above look in the players direction. I need the rotation to be relative to the axis created by this rotation. I feel like it shouldn’t really be this hard to do.

It’s most certainly possible to do it without doing your own calculations. When I get back to my main rig I’ll attempt to put together a working sample.

Okay, I think I’m getting a better picture now. Is the spring arm centered on the object you want to rotate around? Local rotation is based on the origin point of the object rotating. So if you want to use local rotation to get an orbit, you’ll need to parent the object to a transform that follows the target, then rotate that parent along the local axis.

Otherwise you can calculate the position and rotation as a trigonometric function of time based on the target object’s location.

yes, what you described is what I’m doing I think. The parent of the object shown above is rotated to face a direction, and then I want it’s child object (attached to the spring arm) to rotate relative to the parents transformation.

It is certainly possible to do this using trigonometry, but alas that is why I thought I’d ask on here before I hard-code it myself. it just seems so simple that I’m surprised it’s not natively supported by UE.

That would be awesome. Yeah, I’m thinking it would be the equivalent to using a rotation matrix transformation on any rotation done to the existing point. I am under the impression this is the way that rotators in unreal work anyways, so I’m sure that it’s my lack of knowledge in Unreal that is the true problem.

Here’s a video of the effect I achieved: [YouTube][1]

And here is the code and component structure:

So I think I realized what is actually going on, is that the rotation of the object itself is not relative to the player when I use findlookatrotation. It’s always fixed in the standard xyz axis. This is really my culprint, not sure where to go from here. I’ll try to find a screen recorder so I can show you what is going on.

So here is a video showcasing my problem, hopefully it’s more obvious this time.

I modified my code given above just to change SetActorRotation to AddLocalRotation to the sphere component which I also changed to a cube to make it easier to visualize.

You can see that the problem is that the direction the spheres move from the players perspective changes at different locations. The spheres should appear to be moving the same direction relative to the player regardless of the starting position of the player.

I managed to get it working! I appreciate your help, you definitely pointed me in the right direction. So what I did was inherit the camera rotation into the parent of the orbiter, and it worked like a charm!

Ah, okay. That would make sense. I guess I had assumed the starting orientation of the spring arm. Glad I could help!