Jump to content


  • Content Count

  • Joined

  • Last visited

About Spankied

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The best way to do this is to create a navigation mesh on your scene. Then when the user clicks on an area, if the navigation mesh is picked I move the character to that point on the mesh. pointerDown(evt){ let scene = this.scene; let pickResult = scene.pick(scene.pointerX, scene.pointerY); if (pickResult.pickedMesh == scene.getMeshByName("Navmesh")) { this.player.trigger('move', pickResult.pickedPoint.clone()) //player.action } else { this.showActionMenu(pickResult.pickedMesh, scene) } } Heres
  2. I'm working on an ECS. You can checkout code here. Below is a snippet of how its structured. class Entity { foo() { console.log('foo from Entity'); } } Entity.with = function (...components) { return components.reduce((base, component) => component(base), this); } let ActionComponent = (base) => class extends base { foo() { console.log('foo from ActionComponent'); if (super.foo) super.foo(); } }; let NavigationComponent = (base) => class extends base { foo() { console.log('foo from NavigationComponent'); if (super.foo) super.foo(); } }
  3. Will changing Control.AllowAlphaInheritance = true fix it. I've tried in the playground.
  4. Yes. The extension utilizes metadata exported from Unity by the toolkit to offer babylonjs analogs to features Unity offers. This includes, component scripting & blend trees. When you preview a scene using the editor toolkit in Unity, this code gets ran in the preview window.
  5. Took me a minute to understand. You are saying that it does switch from hover state back to its original alpha, which is .9 because it doesnt inherit the containers .4 ?
  6. So should I dispose the ADT instead, and reinstantiate it everytime? I want to hide the Menu and get rid of the buttons onPointerOut. Also, can you look into why these button stay in hover state, even after pointer out. https://www.babylonjs-playground.com/#PUC95T @Deltakosh
  7. This one gets ugly. Rectangle controls on Rectangles controls doesnt work, so I layer a StackPanel in between. This messes up the root rectangles onPointerOut observable. https://www.babylonjs-playground.com/#XQLXSI (with StackPanel) https://www.babylonjs-playground.com/#XQLXSI#1 (without) Check console logs, notice onPointerOut for PG with StackPanel is only triggered sometimes. Not sure under what conditions the rectangle control's onPointerOut is triggered. The second playground, rectangles on rectangles, is missing the 'Choose Option' header. Also, Advance
  8. I edited my OP and the PG with new info on issue
  9. Not really sure whats going on here. Normally ArcCamera allows you to control the camera angle onPointerDown and releases its control onPointerUp. However, when I also modify a user interface onPointerDown, the ArcCamera control is locked, and isnt realsed until the interface is not visible (click button). https://www.babylonjs-playground.com/#TWTL5J
  10. solved by Ssaket. https://www.babylonjs-playground.com/#LRS51E
  11. So this kinda works.. https://www.babylonjs-playground.com/#NVY5B4 Breaks as soon as you play with canvas or browser dimensions. Next tried to do some calculations following this StackOverflow post https://www.babylonjs-playground.com/#NVY5B4#1 The PG is broken, canvas.getContext('2d') returns null. I suspect I will need to get the AdvancedTexture context, but not sure how. Than use it's currentTransform property to calculate the position. Open to ideas. Solved by Ssaket - https://www.babylonjs-playground.com/#LRS51E
  12. The buttons onPointerOutObservable now triggers the rectangles as well. This isnt intended behavior. @Deltakosh´╗┐
  13. I have a rectangle interface with an onPointerOutObserver handler that hides the interface. https://www.babylonjs-playground.com/#65I7QC In the first playground, I can move the mouse anywhere in the interface and it will remain visible. https://www.babylonjs-playground.com/#65I7QC#1 In the second, if I hover over the button in the interface, the interface is hidden. This is not intended behavior. If I set button.isHitTestVisible = false, the rectangle observer isnt triggered. But the button observables wont be triggered. I think the functions in question are _p
  • Create New...