Hi there!
I am new to playcanvas but 3D artist since some decades and know a little about game mechanics in other game engines, but much and nothing about scripting.
I wanted to add a camera to my scene wich is able to fly. This is already working with adding the flyCamera script from the github to the scene camera:
I asked the topics here about “free camera and collision” but got no results for this combination so far. Wondering about that because I thought this feature is often used by viewing 3D objects, e.g. product presentation. Seems I am mistaken about that “often” ^^
So, now this cam should be able to collide with the objects in the scene. The moment you fly, you shouldn’t go through walls. So I also added collision components to all meshes (except “Frame”, it is unimportant right now), switched them to ‘mesh’ and - no camera-collision
I guess there has to be some kind of collidable object bound to the camera wich takes care of the collision, right? If so, how to do that? I already have a small box with collision and parente it to the camera and moved also the script to the box. Again, flying is possible, but the box won’t collide with the scene objects.
Has the collision to be added in the script instead? Again, if so, how then?
https://playcanvas.com/project/1019969/overview/316rueb_test_01
I already thought this mechanics could be either very easy or very complicated to get to work. It seems to be a bit more complicated, like in other game engines as well (or I always miss the point ^^ ).
Thanks alot for your help in advance