How to make Orbit Camera focus on different entities

Hi this is an old post, but i was wondering if there is any code / example project that actually does what you wanted? please understand, i can’t really code, i’m trying to make it work with scripts from other projects.

is it possible to do it without the need to create fixed paths/points for the camera in the code? Like a flexible/ dynamic path that is created by clicks on specific entities ?

Please take a look at my example project here: PlayCanvas 3D HTML5 Game Engine

So far I found a script that makes the camera go more or less whereever the mouse clicks. This is not exactly what I need but it examplifies in a way my idea.

What I need is

  1. I want to be able to click on any box that is part of RING2 parent (which is rotating) and make the camera focus and follow it in frontal view. (Imagine there are drawings displayed on it and the camera keeps it focused the same way but moves with the rotation)
    I’m also looking at this example project: PlayCanvas 3D HTML5 Game Engine - basically what I’d need added is to the possibility to change the targeted entity by a click - and also be able to click away in empty space to be able to orbit around completely free again.

  2. also being able to camera orbit freely around (right now i think the camera.js script seems to interfer with mouseinput/orbitcamera/touchinput) How can i have both working?

So the camera chase script only reacts if an child entity of RING2 parent is clicked on, otherwise one can move orbit camera with clicks/touch input.

thanks so much for any advice, example code, suggestions!


Not sure what end result you are aiming for here as there’s quite a few things in the in your post? Maybe if you start with one particular feature and work from there?