Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

How to make all Guns look at the same point

$
0
0
Hi ! I have a little problem with my Unity 3D Game. I need that all my guns point towards a same point, controlled by the mouse. Look at this picture : ![alt text][1] [1]: /storage/temp/65283-issue.png The first gun is pointing correctly to the mouse position, because in game, the camera is situtated at this gun (first person). **But the second one (underlined) point also at a rotation, but this rotation is the same as the other, but I want to correct this rotation to point at the direction the first gun is pointing.** Here is my code that control the rotation for each gun : gun.transform.Rotate(new Vector3(-Input.GetAxis("Mouse Y"), 0, 0) * Time.deltaTime * 200); arm.transform.Rotate(new Vector3(0, Input.GetAxis("Mouse X"), 0) * Time.deltaTime * 200); Thank you for your help !

Viewing all articles
Browse latest Browse all 592

Trending Articles