[C#] [2D] Not changing positions correctly
Hello, i have a problem. So, i made rotating arm, in 2d game. But i want to change positions on mouse position. But it doesnt change to right one.. if (_mousePosition.x > PlayerMainObject.position.x) { FistParent.position = new Vector2 (-0.252f, FistParent.position.y); } else { FistParent.position = new Vector2 (-0.1f, FistParent.position.y); }
How the arm are before launching(how it suppose to be): http://i.imgur.com/KcSa6LH.png How it is: http://i.imgur.com/4vzxeC6.png
And it justs stays there, it must fallow, but it doesn't.
Transforms(Before): http://i.imgur.com/sUnreqA.png
Transforms(After): http://i.imgur.com/R2FBbrW.png
And if i delete those lines, its all normal, but i need them so the arm doesnt stay in one position when player rotates. Here it is normal: http://i.imgur.com/KRZgpGF.png But here it just hangs in air, because the player rotated: http://i.imgur.com/2AaIq7a.png
Im been strugling with this problem for a day, and i dont know what to do, please help :)
Your answer
Follow this Question
Related Questions
IMPORTANT! how to set float to the player x position 1 Answer
Calculate a point in space based on a triangle 0 Answers
Player Can Not get off platform 1 Answer
Rigidbody movement: Changing the Y of transform.position makes my character stutter 0 Answers
How do I make my player's movement relative to Main Camera's direction? 1 Answer