How do I set the rotation of an object to always be 90 degrees in relation to another object?

if the red arrow is the enemy’s forward direction, and the orange arrow is supposed to always be 90 degrees from the red arrow.

But the orange arrow should be in 90 degrees, in the direction that the player is angled to the red arrow.

is there a way to make this??

Do you mean something like this?

If that’s the case, and you don’t want to care about the rotation of the other object, that’s pretty easy.

We get the location of ourselves and the actor we want to rotate based on. Then find the look at rotation, rotate that 90 degrees, and set our new rotation.

Isn’t it `Right Vector``Rotation From X`? Or am I misinterpreting this?

I don’t know if it makes any difference but it is two arrows on the same object I use, instead of actors

no idea

I don’t know if this makes it more clear

Ok I get what you mean. That’s a bit more complex.

Here’s my stab at it.

Basically just squishing it into a single-degree coordinate system based on the rotation of the actor.
Here’s the only part you’ll have to change:

Just set DistancePerRotation to be however many centimeters you want to have to travel before the object makes a full rotation.

Also, I’m pretty sure this is just to not have to draw an infinite number of rotations, but in case you wanted it to snap, you can tack this onto the end:

Just make snapping degrees be some value that you want it to snap at. Should be some value like 180, 90, 45, 32.112562123.

is it necessary to use actors for this to work? the reason I use arrows is to see the direction to apply force in, but the arrow doesn’t rotate at all, maybe I’m just making a mistake somewhere.

Ooooh the arrow wasn’t a representation of the right vector, it was an actual arrow.
But with the current system as is, it is meant to be an actor rotating something inside it.

Also if you’re rotating an arrow, you should use Yaw or Pitch- however you have it oriented. Roll will appear to not do anything since it’s a perfect circle all round.

Alternatively if you actually just need it as a direction of where they’re going, you can just do this:

oh no sorry, I don’t think I explained it well, is the orange arrow in the earlier picture that I am looking to change.

Maybe it’s about left / right rather than rotations?

This is a pleasantly confusing thread.

@margonvinther If all else fails, consider telling us what you’re really doing; like:

The player has a Flying Raven Companion who needs to hover over our right shoulder.

Describing vector trig can be a royal pain in the neck. For example, what is left / right in the above might change depending on direction others face.

2 Likes

I also want to give it a try!

2 Likes

Way more confusing than it should be
you are pretty close actually, you might remember me, is the devil daggers enemy I am still trying to find a solution for.

that’s so close!
can you make the yellow arrow rotate around the red instead of snapping?

That’s what mine does…

2 Likes

I couldn’t get it to work, sorry.

Something like this?

The closer InRange A/B are the narrower the arc (if that makes sense):

1 Like

what’s this?

I assume that the ball is the target no?
would this not work as well?