- Home /
A Perfect Question for Bunny83 hehehe
Hello,
@Bunny83 So the weapon is attached to the right hand palm and i am using an additional sphere as the limb ik right palm effector. I want to move this ik effector via script to the position so that the ads point (sight of gun) is matching the 0 x 0 y 0 z position with the camera. --> Aim Down Sights
I already got a script which does that pretty good, but only by simply changing the world position of the hand ik effector in the update method. But because of that i cant change the rotation of the hand while playing, which is essential for the Leaning ADS.
I am looking for the localPosition equivalent of this script and (it would be also nice if i could implement it in the start method). I already tried something with InversetransformVector but that didnt worked neither.
void Update()
{
Vector3 direction = Hand.position - Point.position;
Hand.transform.position = Camera.transform.position + direction;
}
example video of script (with Object hierarchy):
Thanks for your help and I hope my english skills where good enough to formulate this question ; )
Your answer
![](https://koobas.hobune.stream/wayback/20220612201910im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
TWO BONE IK in unity 0 Answers
Need the localPosition equivalent of this script 2 Answers
Issues constraining angles in CCD 0 Answers
Having Trouble with Texture Tiling and offset values. Very specific case. 2 Answers
What do you mean by Offsets? 0 Answers