Hello unity community again!
I have a more rudimentary question now, however, I am struggling to find a solution.
I have a 2D player sprite on a plane, all rigged for sprite animation and movement. However, I would like to add a black coloured plane just behind that will simulate his other hand. This hand is meant to follow the mouse.
However, No matter what script or function i use, his arm never follow the mouse properly and often disort it (as i have it in another object ot get a new pivot.)
Is there any way to fix it?
//var tmpPos : Vector3 = Camera.main.ScreenToWorldPoint (Vector3 (Input.mousePosition.x,Input.mousePosition.y,0));
//MousePositionWorld = Vector3(-tmpPos.x,-tmpPos.y, transform.position.z);
//Arm.rotation = Quaternion.FromToRotation(transform.position, -MousePositionWorld);
//Arm.LookAt(MousePositionWorld, Vector3.up);
var mousePos = Input.mousePosition;
// get the mid-point distance between camera and object
mousePos.z = transform.position.z;//Vector3.Distance(Camera.main.transform.position, transform.position)/2;
// look at this world point
Arm.LookAt(Camera.main.ScreenToWorldPoint(mousePos));
Here is a picture to help you understand on what exactly I want to do.
Thank you for your help in advance, hope it is resolved soon. -Lachee