How to set an object position to be the on the other side of the player?

I’ve been stuck on this for a few days, and couldn’t find anything online about it.

I’m making a 2d game, and I have two objects, TouchPos, and SpringPos. TouchPos is where the mouse/touch is, and I need to move SpringPos to the opposite side of the player, from where TouchPos is. Any ideas on how to accomplish this?

I already have the Angle and Distance that TouchPos is from the player, if that helps.

Vector3 Direction = (PlayerPosition - TouchPosition).normalized

Gives you a direction vector from the touch position to the player position.

Vector3 SpringPosition = PlayerPosition + (Direction * Distance)

Will give you a position on the opposite side of the player to touch position, at the distance from the player specified by the Distance float.

1 Like

This worked perfectly! Thank you so much!