syed samoon Posted December 6, 2017 Share Posted December 6, 2017 when i create and use raycast in my scene it is in not in exact position means the below code is i'm using. based on the code the ray can be in straight line towards z axis but it is inclined var front = new BABYLON.Ray(); var frontHelper = new BABYLON.RayHelper(front); var frontLocalMeshDirection = new BABYLON.Vector3(0, 0, 500); var frontLocalMeshOrigin = new BABYLON.Vector3(0, 0, 1); var frontLength = 3; frontHelper.attachToMesh(this.__this.player, frontLocalMeshDirection, frontLocalMeshOrigin, frontLength); frontHelper.show(this.__this.scene); Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted December 6, 2017 Share Posted December 6, 2017 Hi @syed samoon Does your player mesh have rotations? http://playground.babylonjs.com/#LDQ7WA Quote Link to comment Share on other sites More sharing options...
adam Posted December 6, 2017 Share Posted December 6, 2017 Try normalizing frontLocalMeshDirection. 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.