Camera move on click

I’m trying to get the camera to move when clicking on a button, something similar to sketch fab. I have this tutorial for the hot spots which works well:

then i want to use the lerp script from here:

is it possible to get the lerp script to work once the hot spot is selected?


Hi @jono3d,

You might want to consider using the Playcanvas Tween Library for moving your camera:

Then you could create your smooth movement by calling the tween events from the button.


Hi @jono3d,

I took a bit of time to throw this project together for you. The code isn’t super clean, but there are plenty of comments to give you an idea of what is happening and how you might want to approach this topic in the future:

Here is the project so you can look at the code:

I hope this is helpful


super helpful! thank you so much very kind :slight_smile:

1 Like