Noob trying to create a simple 'teleport to location and look at object' script

Hi Everyone,

I’m totally new to Playcanvas but not Javascript - however, the way Playcanvas uses JS is kinda alien so I’m trying to get through the fog of knowledge and build something simple. So far, not successfully!

I forked one of Yaustar’s scripts to make this - PlayCanvas 3D HTML5 Game Engine - which I’m sure looks like a horrific mess to the trained eye :joy:

I’m attempting to make it do a simple ‘click the hotspot and teleport to it, then look at the cube’ but it is doing odd things like when the hotspot is clicked the view lerps in a complete rotation to bring the cube (almost) into view instead of taking the shortest route. I’ve also found if I change the camera parent shape that breaks the hotspot click JS for reasons I cannot fathom!

I’ve got quite a big project to try to build with plenty of hotspots so I expect I’ll be posting many noob questions over the coming week :sweat_smile:

If anyone fancies having a look at the project and pointing me in the right direction that would be brilliant!

Thanks