# Tweening Position to Angle

I think that within the Tween extension, there should be an action that allows you to tween an object’s position by a specified distance, at a specified angle. It would allow users to tween objects in situations where it has to go a certain direction, but the X,Y is not necessarily known. Doing this with trigonometry is sketchy at best, from my experience, and tweening position by angle would make the process a whole lot easier and more secure.

1 Like

You can tween object variables and use those variables in any action.

Just to clarify on this, Triarite’s asking for a tween method that lets you say “tween an objects position in an direction/angle”. Sort of similar to the “Apply force (angle)” action, but via tween.

There’s not quite an equivalent right now that we could find.

Right, I was a bit too quick on this.

I’m not sure I would call trigonometry sketchy, because I think it’s what would be used if the feature was added.
My math is too rusty for that I’m afraid. I think it’s about sine/cosine of the angle to get the x/y ratio, multiplied by the distance… Something like that.

I can only agree with the feature request considering my math illiteracy…

I’d prefer an expression like `Object.GetPositionOfDistanceByAngle(distance, angle)`, it would be more powerful as it would be useable everywhere.

I agree, but how would you return x and y?

Oh, true I guess it would have to be `Object.GetPositionOfDistanceByAngleX(distance, angle)` and `Object.GetPositionOfDistanceByAngleY(distance, angle)`

Oh, true I guess it would have to be `Object.GetPositionOfDistanceByAngleX(distance, angle)` and `Object.GetPositionOfDistanceByAngleY(distance, angle)`

Are there any plans to implement this, or is there a workaround available?

the way without math (from your side) might be to create an object and position it using “put an object around another”
then tween the object you want to that position object.

trigonometry would be much more efficient tho.

@Triarite
The formula is:
moveToPosX = distance * cos(angle) + currentPosX
moveToPosY = distance * sin(angle) + currentPosY