Move object to clicked position on mobile

Is there any example how to place or move object to clicked position? I was checking all needle examples but there is any which works like this. I need this for camera movement on mobile. I want to place and object to clicked/touch position, and then use smooth follow script attached to camera to move camera slowly to clicked position. Please help. I am not coder, I am searching this more ethen 3 days, I tried ChatGPT to heelp me write the script :slightly_smiling_face:

Original Post on Discord

by user 869976161550217286

I’ll try to write you a little example

This is basically all you need: https://stackblitz.com/edit/needle-engine-place-on-click?file=src%2Fmain.ts

There’s a “MoveToClick” component that you can add to an empty gameobject in Unity and then link the camera+smoothfollow to the empty gameobject

Alternative example with the camera following + rotation: Needle Engine - Move Camera onClick - StackBlitz

All this would be setup in Unity, you dont have to code it

that’s what you can add to a new script in Unity and add it to your object that smooth follow should follow

Hello Marcel, thats epic! thanks a lot, this is what I need, I will dive in to your code and try lern how it is made. Thanks a lot.

by user 869976161550217286