Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Moving Object to where I click 3D

Discussion in 'Scripting' started by Bwuh, Apr 8, 2021.

  1. Bwuh

    Bwuh

    Joined:
    Jan 19, 2021
    Posts:
    1
    Yo pretty much in my game you hit a ball with a golf club and i am trying to make the ball go towards the center of my screen, is the best way to do this with raycasting? Or is there some better way?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    You can definitely do it with raycasting.

    There are also a LOT of existing Youtube tutorials explaining precisely what to do.

    Screen Shot 2021-04-08 at 3.12.09 PM.png