Hello Coders, in this video Jared shows us how to create a C# script in Unity 3D that can manage the rotation of our cannon by clicking and dragging gameobjects in our scene. We use several functions in order to achieve the gameobject rotation that we are looking for and we make use of raycasts in order to get our mouse position in the scene. One of the most important functions in this script is the camera.ScreenPointToRay function, and we also lerp Quaternions in order to smoothly rotate our gameobject in
آی-ویدئو