Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Grappling hook with tilted camera
#4
I come back to this thread and try to give better examples. See images.

With tilted camera hook attaches to different points in z-depth if I click lower or higher (I don't click the object..).

When camera is not tilted hook attaches always to same z-depth.

        // Get the mouse position in the scene, in the same XY plane as this object:
        Vector3 mouse = Input.mousePosition;
        mouse.z = transform.position.z - Camera.main.transform.position.z;
        Vector3 mouseInScene = Camera.main.ScreenToWorldPoint(mouse);

Maybe I have misunderstood how this script should work when it calculates the attach point.. Does it affect the screen point calculations if user clicks on the "sky"?


Attached Files Thumbnail(s)
           
Reply


Messages In This Thread
RE: Grappling hook with tilted camera - by illustrator - 20-08-2020, 07:41 PM