Jump to content

Search the Community

Showing results for tags 'actionmanager'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





  1. Hi guys! I find a problem that i can't make the arcrotateccamera rotate to the nearest 'destination'. here is the PlayGround. https://www.babylonjs-playground.com/#RVZ1O#2 Rotate several circles around the center, then click the purple button. You will find meshes rotate back quickly to the original position before rotation. I want the purple button rotate to the position which camera.alpha=0 or PI but not rotate to the original position(for instance, the button just rotate a angle about -PI/2).
  2. Using the action manager's .registerActon and .then, if I start the next interpolation before the previous one finishes, it looks like the last 'frame' briefly flickers while the second one is playing. https://playground.babylonjs.com/#LXF99J Click the sphere to start it moving, click it a second time before it's finished animating to see the effect. Is this the expected behaviour? Is there a way of avoiding it?
  3. Refer to the playground url below, sprite is in front of the sphere, however the click / pick event triggered on backend sphere first regardless of the sprite's position. Url: https://www.babylonjs-playground.com/#9RUHH#29 Expected result: Player clicked will be triggered instead of Sphere clicked.
  4. Hello coders, I tried scene.actionmanager( etx and if(evt.sourceEvent.key=='f') { Let sphere666= etx sphere666.position.y= evt.pointerY } so basically what I want is press f and create sphere at where mouse is at the code is THE parts i remember rn. problem is its not Creating a sphere but pointerX is correct values etx anyone can help?
  5. The general question is: what if I need to remove an action from an actionManager ? I looked for a unregisterAction/deregisterAction on ActionManager class, or a dispose method on the action class but it's not available, am I missing something or it's a feature to implement ? My usecase: I use thin cylinder meshes to draw wires, in order to use mesh collision actions. Wires can be set longer or shorter at runtime, so I dispose and recreate those meshes, but what happens to the actions registered on the actionManagers of the other meshes (OnIntersectionEnterTrigger,OnIntersectionExitTrigger) to check for object-wire collisions ? I'm afraid they remain even if they can no more be called, being the mesh disposed now. Thanks
  6. Hi everyone, I'm just discovering BabylonJS and this is my first post ever on a forum so please be patient with me So, I'm working on a small project which consists at the moment in creating meshes via a funtion addMesh(), and I wanted to add a "selection animation" to all my meshes, basically by changing their color to an emissive white one. However, this seems not to be working, and I saw on other topics that I needed to create an actionManager for every mesh of my scene. Is there any way to make my code bellow work and have an actionManager associated to all meshes created by my function addMesh()? Here are the 2 main functions : var makeOverOut = function (mesh) { mesh.actionManager.registerAction(new BABYLON.SetValueAction (BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor)); mesh.actionManager.registerAction(new BABYLON.SetValueAction (BABYLON.ActionManager.OnPointerOverTrigger, mesh.material, "emissiveColor", BABYLON.Color3.White())); mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction (BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(1, 1, 1), 150)); mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction (BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(1.1, 1.1, 1.1), 150)); } function addMesh() { var box = BABYLON.Mesh.CreateBox('box', 100, scene); box.position = new BABYLON.Vector3( Math.random() * 480, 50, Math.random() * 480, ); makeOverOut(box); } Thank you for you time, any suggestion would be appreciated ! ps : Sorry for my English .
  7. Hello and <ping> Q: about Touch.... Getting an Offset of the Pointer on the lower right: The grey dot draws the blue line at offset upper left. Reproduced using Chrome in the Chrome Emulator. But first experienced it in a site using BJS 3.0 with both Hand and then PEP - on a Google Pixel. Replicated in a local sandbox, I'll build a playground... It uses this code: scene.onPointerObservable.add(function(){ console.log('movin') },BABYLON.PointerEventTypes.POINTERMOVE); //TODO - initPickEvents = function // ----------------------------------------------------Register Pointer Events. var meshes = centerTiles; //TODO rename tiles and move up with other code. for(var i = 0; i < meshes.length; i++){ mesh = meshes[i]; mesh.actionManager = new BABYLON.ActionManager(scene); // trigger actions mesh.actionManager.registerAction( new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickDownTrigger, function(){ // debugger; console.log('DOWN') }) ); mesh.actionManager.registerAction( new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function(){ console.log('UP') // debugger; }) ); } with this: <canvas id="renderCanvas" touch-action:"none"></canvas> Any tip on things to try? : ) SOLUTION: gotta use meta tag to set device-width. Zing.
  8. Hello! Probably I've found a bug with ActionManager and it's intersection triggers. In my case there is a bigger container, smaller mesh inside it and a sphere which moves through them. PG demo: https://playground.babylonjs.com/#6CY2EU#1 If you check the console - you will notice that inner mesh's OnIntersectionEnter is triggered only once, while bigger container's OnIntersectionExit triggers every time. Expected result: both Enter and Exit triggers are fired every time. NOTE: if you make both triggers the same (OnIntersectionExitTrigger or OnIntersectionEnterTrigger) - everything is fine, so something is wrong with opposite/different triggers.
  9. Hey guys, is it possible to select a sprite (via actionManager or scene.pickSprite, whatever) so the sprite transparency is taken into account? For example, in this playground the sprite is a circle: https://www.babylonjs-playground.com/#PVYYAQ , but it is clickable on the invisible corners of the square image. Is there any way to avoid that? Thanks,
  10. Hello, I have a mesh that is clickable and i would like to prevent it being clicked if there is a GUI element in front of it. Playground: http://playground.babylonjs.com/#84Q5FX In this example i made the GUI clickable as well, but i would like the GUI to stop mesh from being clicked even if there wasn't click function assigned to it. Is this possible? I can almost do this with my own input handler, but it only works like 90% of the time. And it's a bit funky involving global cooldown on clicks. It also requires me assigning an empty click function to the GUI.
  11. Hi everybody: I need to know about what is the preferred approach to handle the mouse/touch events (for example onclick): (1) via the canvas by means of myCanvas.addEventListener("pointerdown", function (evt) { ... var pickInfo=myScene.pick(myScene.pointerX,myScene.pointerY,function(mesh){ return (mesh===myMesh); }); if(pickInfo.hit){ alert("Mesh picked"); } }); (2) via the mesh using the powerful ActionManager functionality myMesh.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickDownTrigger,function(evt){ alert("Mesh picked"); })); Thank you for your time.
  12. Hi, Don't know if this is intended behavior but ActionManager executes actions on disabled meshes too. Don't want it run on disabled meshes. Also actions registered with a parent mesh are not executed by children. Got children to execute parent action by registering action to each end child. For meshes disposed/created actionManager to toggle action execution when they are disabled/enabled. So found a way around both, if anyone is looking for it. If there is a better way, please tell. Would love to see ActionManager handle this internally. Thankyou And yeah pg: http://www.babylonjs-playground.com/#IJKYDQ
  13. Hi guys, I'm having a hard time figuring out how to move a given object to the destination of a clicked mesh. Playground link (similar recreated scenario): http://www.babylonjs-playground.com/#2CFAMI#13 As you can see, the first two actions (hovering mouse in/out effect) work fine with every tile, but the animating action seems to always extract the position of the last added tile. I'm suspecting it's because I'm overwriting the tile variable (and thus its position values) or something. I also suspect that using instances for the tiles might be a better option, since in the game they also just use 5 different materials that are loaded before-hand...but first things first. Thanks in advance for taking a look!
  14. Hello, I find that the Observable class is useful to handle events. However the ActionManager class offers more types of events such as long press for instance but we can only use it on meshes. I would like to know the fundamental difference between these two classes. Does one depend on the other ? How can I reproduce the events from ActionManager for the Observable ? Thanks
  15. Hi everyone, I am pretty new with babylon.js and have a question about the ActionManager.OnIntersectionEnterTrigger. Is it possible to use this trigger with Rectangle2D in a ScreenSpaceCanvas2D? So what I want to do is to move 2D objects in a ScreenSpaceCanvas2D and trigger a event if two of them overlap on each other. I have already tried several thing but it doesn't seems to work.. Thanks for any feedback
  16. Hi Is there any sample for dragging and collision detection implemented by actions (new features in v2.4) . my scenario : i have 3 ball(mesh) and 6 placeholder(mesh) on a board(mesh) . i want to drag balls via touch or multi touch to any placeholder on board . i read http://www.html5gamedevs.com/topic/16994-understanding-drag-and-drop-playground-sample/ and implement http://playground.babylonjs.com/#279FW9#4 , its good but i want to use actions and triggers (ActionManager) for pick up/down/move and collision detection. Thanks .
  17. PLAYGROUND : http://playground.babylonjs.com/#1GM4YQ#123 PROBLEM: Clicking on GREY boxes displays wrong message. Should work the same as clicking on RED boxes. MORE INFO: One function is creating elements from predefined array. Second function is dynamically creating elements using FOR loop and I don't quite understand why it is not working properly. As you can see on the playground: clicking on RED boxes works just fine. The browser correctly displays clicked box's index. However, clicking on GREY boxes always displays the same message. Thank you for reading, Saafine
  18. Hello I got a 3dModel of an elevator. I trigger a button for it's position with the following code: myMesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, myMesh,"position.y",-2.6, 1000)) //down .then(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, myMesh,"position.y",0.001, 1000)); //up Witch works great! Accept when my char wants to get up again, he is falling through the ground, - the mesh. Few workarounds that come into my head, like check the state of the "event" an apply new gravity or new cam position. What's the easiest one? Any suggestions are highly appreciated! Best
  19. Hi guys, Trying to get action manager to work with multiple view ports. I am having an issue, that seems to be closely related to this question asked almost 2 years ago. (http://www.html5gamedevs.com/topic/5973-multiple-viewport-issues/) Take a look at my playground: http://www.babylonjs-playground.com/#1QXZAA#4 You will see what i am trying to do. Get the actionmanger to fire when mouse moves over the sphere. Code works well if you get rid of view ports. It doesn't work on its own (the hit test is far off in the distance) I have put an option2 in there, that works great. But it registers a camera to a pick test every frame. And this is my problem. Constantly running a registerBeforeRender pick test on an object every frame for what could be over 100 different objects in my application. This seems less than optimal. Or does actionmanager just basically run every frame as well so there is 0 difference in speed/resources? Regardless, I would still like to use actionmanager as its cleaner code, and on top of that it is simple to remove the actionmanager by just removing an object, rather than having to unregisterBeforeRender every object when it is removed. Thoughts? Thanks!
  20. Hello, I'm using a ActionManager.OnPickUpTrigger to trigger a translation of an object. It works well, and was surprisingly easy to setup. But I have a problem : actions are triggered even if the object is hidden behind another one. You can check it on this babylon playground : http://www.babylonjs.com/playground/?17 If you click on a target through the moving torus, the target is picked and triggered anyway, as if it was visible. Is it the correct behaviour ? Should I use a more traditionnal picking code instead ?
  21. Hello, is it possible to use mesh.actionManager.registerAction(new BABYLON.SetValueAction({ trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: otherMesh }, mesh, "scaling", new BABYLON.Vector3(1.2, 1.2, 1.2))); http://http://doc.babylonjs.com/tutorials/How_to_use_Actions without defining the 'otherMesh' at the beginning.So that i get the 'otherMesh' as an object when the trigger fires/ on Intersection? Thanks!
  22. Hello to community ! It's time to present you the Actions Builder that is a part of the 3ds Max plugin (and soon available in the Sandbox). The Actions Builder is an initiative of the Babylon.js team to help 3ds Max artists to create actions on their meshes without any line of code. Installing the Actions Builder The Actions Builder is a folder named "BabylonActionsBuilder" located in the same folder as the Babylon.js 3ds Max plugin (typically "C:\Program files\Autodesk\3ds Max 2015\bin\assemblies\"). The "BabylonActionsBuilder" folder must contain: - "fonts" folder - actionsbuilder.max.js - babylon.max.js - fonts.css - index.css - index.html - raphael.js Using the Actions Builder The way to work with is simple: - Select a mesh in 3ds Max - Right click on it - Select the "Babylon..." menu and click on the "Babylon Actions Builder" menu - The Actions Builder window appears - You can now add actions to your meshes - Export your project using the Babylon.js plugin and that's all Configuring actions in the Actions Builder Each action you'll add on your meshes is raised by a trigger. On the left side you have a list of elements ready to be drag'n'dropped in the graph (middle side): - Triggers: events that raise actions - Actions: actions executed by Babylon.js - Conditions: conditions checked before executing an action The pipeline is: - Drag'n'drop, from the list, triggers on your mesh - Drag'n'drop, from the list, an action/condition of your choice on one of you triggers or actions - At any time, click on an action, trigger or condition to edit its parameters. Parameters appear in the right side of the window Conclusion Full presentation and tutorial are available here: https://medium.com/babylon-js/actions-builder-b05e72aa541a It's a call for help, 3ds Max users, to get your feedbacks on this feature to improve and improve it again. By hoping you'll get a rich experience with actions
  23. Hi, I'm looking at the excellent example at http://playground.babylonjs.com/#HSVQL (lines 118-130) and was wanting to know if there was a way to attach an action to a Dynamic Texture (line 118), or it's related 'context' (line 126) ? I was wanting to use this idea in an in-game 'menu', and be able to display a set of options, you know, like a menu... and the user to be able to select one. I'm using a ArcRotateCamera and love how the text is always facing the user. I believe that an ActionManager is only attachable to a Mesh (and not a DynamicTexture), and the canvas CanvasRenderingContext2D object that the myDynamicTexture.getContext() returns doesn't appear to have any funtionality I'm after (like readMousePosition() or something similar). I initially thought of producing 2D Plane meshes for the menu, but I'm not entirely sure how to go about forcing them to be always facing the user ? Any ideas or guidance is very appreciated. Thanks, bws.
  24. I have a multiview, 3 cameras and viewports, and switching from "old way" to manage actions to the actionmanager one. I use ExecuteCodeAction with trigger OnLeftPickTrigger and it does activate an event only on one of the views, so one camera only. RegisterAction has no camera parameter thus I would expect babylon manages the right camera for picking meshes, based on viewports and mouse coordinates, but it does not seem the case. Any clue or suggestion? Thanks
  25. The below code is a snippet from the following location: http://www.babylonjs-playground.com/#DNOLK#1 My question should clarify what I'm asking, even though the above code works (eg. doesn't throw an error). What I was trying to accomplish was taking both actions and causing them to fire at the same time. So far the above code sets both properties, but only by allowing it to take turns alternating each time the intersection occurs. My question is: is there a way to change both "scaling" and "emissiveColor" during the same intersection instance? Thanks in advance for the help.
  • Create New...