• 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 some resources for baking a nav mesh. You can checkout my code here and see demo here. Also, Wanadev created a pathfinding library for babylonjs that uses the A* search algorithm to find a path on a nav mesh.
  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 (; } }; let NavigationComponent = (base) => class extends base { foo() { console.log('foo from NavigationComponent'); if (; } }; class Player extends Entity.with(ActionComponent, NavigationComponent) { foo() { console.log('foo from Player');; } } new Player().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. @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. (with StackPanel) (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, AdvancedDynamicTexture.clear() appears to do nothing. I expect it to behave similar to dispose? Trigger an onPointerOut to reproduce. (clear) (dispose) *cough* @Deltakosh *cough*
  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).
  10. solved by Ssaket.
  11. So this kinda works.. Breaks as soon as you play with canvas or browser dimensions. Next tried to do some calculations following this StackOverflow post 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 -
  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. In the first playground, I can move the mouse anywhere in the interface and it will remain visible. 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 _processObservables and _processPicking here fixed :