Alenvei

Members
  • Content Count

    51
  • Joined

  • Last visited

About Alenvei

  • Rank
    Advanced Member
  • Birthday August 27

Contact Methods

  • Twitter
    dayest

Profile Information

  • Gender
    Male

Recent Profile Visitors

669 profile views
  1. Alenvei

    Action manager remove issue

    problem is solved https://playground.babylonjs.com/#VZRN2V#11 I changed this lines : Line : 252 and 255;
  2. Alenvei

    Action manager remove issue

    I am sorry. I forgot mention : movement with red box is W, A, D and when you go closer to blue doors my "display" shows up try to click on the display
  3. Hello I am back I have one issue with removing the Actions. The problem is : when I am trying remove the actions from actionManager it takes 2 - 3sec. you can see here : https://playground.babylonjs.com/#VZRN2V#10 I am trying to make sci-fi display for doors to player shoud open the locked doors. When player is close to the display then display shows up and then player is able to click on display. If player move away from display distance then display disappear and player unabel to click on display but in my exampel it works with delay. Where is the problem ?
  4. Alenvei

    Blender Exporter - Animation for 2 meshes

    Are you tried to call animation by name... like this ? BABYLON.SceneLoader.ImportMesh("", "./", "myAvatar.babylon", this.scene,function (newMeshes, particleSystems, skeletons) { var avatar = newMeshes[0]; avatar.skeleton.beginAnimation("Idle", true, 1); //avatar.skeleton.beginAnimation("Walk", true, 1); //avatar.skeleton.beginAnimation("Run", true, 1); });
  5. Alenvei

    Mesh normal issue!?

    Hi @Swapnil Sorry in advance for bad english . It seem you have issue with backface - culing. I dont know how to 3d max works but try to turn on backface - culing in the 3d - max and if you will get same result ... use the tool with name - Flip normals . I hope It helps you
  6. Alenvei

    Exported file transparency issue.

    so I found other solution : https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered I used .visibility and it works like the .alpha... for now... I leave this issue open yet, because I am not 100% sure.
  7. Alenvei

    Exported file transparency issue.

    No I have other issue myObj is now white.
  8. Alenvei

    Exported file transparency issue.

    no it doesn't worksπŸ™ ok it works now I forgot use this codeπŸ˜‚ : var mySuperMaterial = new BABYLON.StandardMaterial("haha", scene); myObj.material = mySuperMaterial; myObj.material.alpha = 0;
  9. Hi guys πŸ˜€ I have one question about exported .babylon file. Is it posibel chagne alpha(transparency) of exported .babylon file? I want to make it slowly disepeat or sotmhig like that. When i change the aplha to 0 nothing happens. BABYLON.SceneLoader.ImportMesh("", "textures", "myObj.babylon", scene, function (newMeshes) { var myObj = newMeshes[0]; myObj.alpha = 0; } So I looked in the exported property whith console.log(myObj). BABYLON.SceneLoader.ImportMesh("", "textures", "myObj.babylon", scene, function (newMeshes) { var myObj = newMeshes[0]; console.log(myObj); } it shows me, that alpha is set NaN. And when I again change the alpha to 0 and looked in the property ... alpha was set 0 but again nothing happens. Why is like that ? Sorry for my bad english. 😁
  10. Alenvei

    GUI issue with raycast

    Thank you for lesson @Wingnut it works perfectly .
  11. Alenvei

    GUI issue with raycast

    Hello again @Wingnut I found one issue but not with label and raycast. I have issue with animation of doors ... You can see exampel in my last post. When I turn on my "game" everything works fine but after five minutes when I open door the FPS go like crazy and evrey minute it's worse only with door animation. I think the raycast making this trabels but I'm not sure.
  12. Alenvei

    GUI issue with raycast

    Hi @Wingnut ..... this is awesome it works perfectly and I learned new things ...thank you very much Wingnut for me you are pro coder . Guys I made for you playground, which is similar with my game . You can find there two rooms with doors. Go close to the door when label ( with the letter E) shows up then press the E-key on keyboard and see the magic W,A,S,D keys to control the RedBox. Have fun: https://playground.babylonjs.com/#VZRN2V#7 I changed this lines : -Lines 26 -97 : only walls -Lines 163 -194 and 219 : implementation animation for doors ; -Lines 230 : executing animation for doors Have nice day
  13. Alenvei

    GUI issue with raycast

    Hello @Wingnut Thank you for your answer... I very appreciate. I was afraid that I will must use more then one label πŸ˜•..... ...because in future I would like to make five more doors and more diffrent "labels" (G, F, Q - keys on keyboard) in first level. I am not sure if It will be good for game performance create custom labels for each door What is your opinion guys ?
  14. Alenvei

    GUI issue with raycast

    sorry I forgot for exampel.... here you can try : https://playground.babylonjs.com/#VZRN2V You can see in exampel GUI works with blue Bigbox, but with green Bigbox doesn't works . Why it is so ?
  15. Alenvei

    GUI issue with raycast

    Hello all Sorry for my bad english in advance . I have a littel issue with GUI and I want to understand why it works like taht . What is the issue ? I made this function : function vecToLocal (vector, mesh){ var m = mesh.getWorldMatrix(); var v = BABYLON.Vector3.TransformCoordinates(vector, m); return v; } class Raycast { constructor() { } doorOpener(letHit, myGUI, scene){ this.scene = scene; var origin = player.position; var forward = new BABYLON.Vector3( 0, 0, 1,); forward = vecToLocal(forward, player); var direction = forward.subtract(origin); direction = BABYLON.Vector3.Normalize(direction); var length = 1.5; var ray = new BABYLON.Ray(origin, direction, length); var hit = this.scene.pickWithRay(ray); if (hit.pickedMesh == letHit){ if (control.keys.ePress == 1){ scene.beginAnimation(letHit, 0, 40, false); } return myGUI.isVisible = 1 }else { return myGUI.label.isVisible = 0; } } } This function is responsible to opening doors. When player reach a door then GUI shows up which key(E) on keyboard must be pressed for open the door but the GUI only works whith one door . Here is how I call Raycast function : const view = require('./ray.js'); const panelG= require('./gui.js'); class Leves { constructor(scene,camera,followCam,canvas) { this.scene = scene; GuiP = new panelG.GuiP (scene); doo = new view.Ray (); BABYLON.SceneLoader.ImportMesh("", "textury/mapy/", "lvl01.babylon", this.scene,function (newMeshes) { var level_001 = newMeshes[0]; level_001.checkCollisions = true; var door = newMeshes[1]; door.checkCollisions = true; var door2 = newMeshes[2] door2.checkCollisions = true; var openDoor = new BABYLON.Animation("t", "position.z", 25, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keys = []; keys.push({ frame: 0, value: 0.45 }); keys.push({ frame:5, value: -1.5 }); keys.push({ frame: 10, value: -3 }); keys.push({ frame: 30, value: -3 }); keys.push({ frame: 35, value: -1.5 }); keys.push({ frame: 40, value: 0.45 }); openDoor.setKeys(keys); door.animations.push(openDoor); door2.animations.push(openDoor); scene.registerBeforeRender(function () { doo.doorOpener (door, GuiP.panel, scene ); /*only animation works*/ doo.doorOpener( door2, GuiP.panel, scene); /* GUI and animation works very good */ }) }) } } I am newbie in babylonjs and javascript too and I want to understand every aspect of babylon js and javascript.