This point will help you keep the object in-tact in z-axis. MyScreenPos gives you the position of the object in the screen Space. Transform.position = (new Vector3(,, myScreenPos.z)) If there is an object lying in the world space and you want to move it to the position where you click (not changing the z position of the object), you can use the following set of code: Vector3 myScreenPos = (transform.position) Let us see an example on how to move from world to screen point and vice versa.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |