OXY11 Posted August 2, 2016 Share Posted August 2, 2016 Hi, how can use setLocalTranslation to move an object toward the camera? myobject.position = new BABYLON.Vector3(20, 20, 20); myobject.setLocalTranslation = ...... thanks Quote Link to comment Share on other sites More sharing options...
RaananW Posted August 2, 2016 Share Posted August 2, 2016 Hi Oxy, I am not really sure what you are trying to do, but it you want the object to always be relative to the camera's position, use parenting. A very simple example : http://www.babylonjs-playground.com/#17CMDG - the sphere will always move towards the camera, no matter where the camera is looking at. If all you want is to translate the object in its local coordinates, use the translate function with BABYLON.Space.LOCAL as coordinates space (the last variable). Hope this helps! 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.