Euler orientation around an offset

I know this is simple stuff, and I’m hunting for the answer myself as well, but I’m stumped by a simple problem: how do I orient an object (not rotate, but just set an angle in degrees), around another object?

As in- doing what RotateAround() does, but manually and statically. I’m pretty new to using eulers, and even a point in the right direction would be helpful.

Thanks~

some illustration of what I’m after:

I want to be able to just hand the script object an angle and go from this:

to this, in one update:

The orientation is done as if the euler pole were at the offset target’s position.

I’m sure this question has been posted here a million times (and I’m trying to find those old posts), but any fresh help would be greatly appreciated. Many thanks.

make the offset target a child of the script target

Thanks~

The setup I’ve got right now is creating an empty GameObject inside the OffsetTarget, parenting the ScriptTarget to it, then orienting the empty object. This works, but it’s breaking some other things I want to do with the script target’s position. Unfortunately I need to do this the hard way, with math. Any ideas?

try something like:

function Update () {
if(Input.GetMouseButtonDown(0)) {
	transform.localPosition = Quaternion.AngleAxis(90,Vector3.up)*transform.localPosition;
}
}