DrEight Posted November 21, 2018 Share Posted November 21, 2018 I'm using the Babylon toolkit for Unity and I'm trying to use the script 'CameraRig.cs'. I've attached the script at the main camera, but nothing happen. Can someone help me to figure out how to add an orbit camera ? I'm developing a 3d viewer so the camera should only orbit around the object. I know how to do it babylonjs alone, but I don't understand how I can use the script in the toolkit. thanks Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 21, 2018 Share Posted November 21, 2018 Hello and welcome to the forum ? Ping @MackeyK24 the unity exporter master Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted November 22, 2018 Share Posted November 22, 2018 You need to implement CameraRig.ts with your Babylon logic... or use my built in Camera Rig component and enable whatever camera type and input you want check the getting started video in the docs to help you get going and how to use scripts in general https://doc.babylonjs.com/resources/intro#getting-started Quote Link to comment Share on other sites More sharing options...
DrEight Posted November 22, 2018 Author Share Posted November 22, 2018 I was expecting to find a file 'CameraRig.ts' in some folders, but I did not. Where is it ? How is it supposed to work the build in camera ? I saw the link you provided and I've also saw this : https://www.babylontoolkit.com/videos/GettingStarted.mp4 However the documentation is non clear on how to use the scripts provided by the toolkit Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted November 22, 2018 Share Posted November 22, 2018 Script are used in Pairs... You create BOTH the .cs and .ts file. Note: The CameraRig is a built-in component (Add Component-->Babylon-->CameraRig). This component has built in features for to rig the camera. You dont need code if using my CameraRig... But you can ALWAYS make your own camera script by creating BOTH the Editor Component and the BACKING CLASS (.ts). Im pretty sure i go over that in the Getting Started video Quote Link to comment Share on other sites More sharing options...
DrEight Posted November 22, 2018 Author Share Posted November 22, 2018 yes I understood what you mean, in fact I'm expecting that when you add the component to the camera with 'Add Component-->Babylon-->CameraRig' the file CameraRig.ts is created as well, but it is not. What am I missing ? Do I have to create the file manually ? Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted November 22, 2018 Share Posted November 22, 2018 The actual code for Camaera rigging is in the SceneManager Extension project ... if you wanna see what I’m doing for camera management, check out the scene manager project Quote Link to comment Share on other sites More sharing options...
DrEight Posted November 23, 2018 Author Share Posted November 23, 2018 It is not working what I do. I'm missing something that I don't understand. Can you be so kind to do a step by step ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.