Search the Community
Showing results for tags 'trigger'.
-
Hi everyone, I've been trying to put together a small interactive scene where the user can click a babylon.gui button to activate an animation. The main issue I'm having is the connection between GUI elements and the per-object event/action system. My idea was to run a javascript function on the button, that then fires the action event, however after looking at documentation and lots of google, it doesn't appear like this can be done, at least not from the given triggers (excluding checking every frame). Is there a better method of doing this? Thanks in advance
-
Hi friends. I want to activate a function when two objects overlap. For example when I overlap an object I want to change gravity of a specific area. I can do this with overlap but it does it for one time, after that everything is same again. For example in the game, I will overlap a potion and gravity between position x1 and x2 will be equal -50. But when I do this, I mean when I overlap the potion, it occurs for one second and after that the gravity -50 turns back its past value.
-
Hi, how can I add a function to the update function when two objects overlapped? I asked similar question yesterday but this time I asked same question in more clear way. For example, I will take a coin and after this my speedPlayer() function will be activated over and over again, infinitely. How can I do this, thanks.
-
Hi, I'm trying to show a text label when I hover the mouse over a mesh (sphere). It needs to show up at the exact position of the sphere. Something like: OnPointerOverTrigger -> show text label OnPointerOutTrigger -> hide text label Not sure if I have to use actions... trigger... pick()...text2d. Couldn't figure it out. Is there a way to do it using HTML? Playground: http://www.babylonjs-playground.com/#NH8WYW Can anyone help me? Thanks
-
How should i create the box mesh to use as a trigger zone... I really want a non-visible box area to walk thru and trigger and event. I get that i can use the action manager and or just check intersects with in update loop. But i can trying to add support for trigger volumes to my BabylonsJS Toolkit and i am creating the box using the babylon.entities api in C#. So i guess what i an asking is 'HOW MUCH' of a regular cube mesh do i need to create for it to be a non-visible at runtime area that still has some kind of geometry that defines that actual area of the box that 'lives' so the mesh.intersect api works. Right now i am making just a normal mesh box and if it is a 'trigger a volume' i just set set the babylonMesh.visibility = 0 and babylonMesh.isVisible = false then just DONT create the mesh materials for it by skipping the if (render != null) section that does all that good stuff. Now is that how i should create an area box? Just make a normal box and set its visible = false... ? Or What ??? Thanks for the info
-
Hi guys, I have a mesh with two triggers assigned to its actionManager: ground.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, function (event){ console.log("OnPickTrigger"); })); ground.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger, function (event){ console.log("OnLongPressTrigger"); })); The thing is, when the OnLongPressTrigger is triggered, the OnPickTrigger is also triggered. Is there any way to avoid triggering the onPickTrigger? Thanks in advance!
- 2 replies
-
- trigger
- onlongpresstrigger
-
(and 3 more)
Tagged with:
-
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
-
I know of onPickTrigger and the other pick triggers that detect when mouse / touch is down. I'm treating objects like URL links so I'd like them to work like web links, which get activated on touch up. So my plan is to detect if the user has touched down, not moved much, then released. Basically comparing distance between touch down and touch up. If they moved a lot I'd like to consider it a swipe or accidental touch, otherwise proceed to the link. Is this possible to do?
-
I'm triggering a tween using: highScore = game.add.tween(highScore.cameraOffset); highScore.to({ x: worldX }, 700, Phaser.Easing.Cubic.Out); highScore.to({ x: worldX + worldX * 2}, 700, Phaser.Easing.Cubic.Out); highScore.to({ x: worldX - worldX * 3},1);which tweens a 'Highscore!' message to the center of the window, off the camera, then back to the starting position. Triggering the tween I have: if (score > previousBest){ newHighScoreText(); }Nice and simple, and it works perfectlym except if I get a new highscore whilst the tween is active, it gets retriggered, messing up the animation. Is there an easy way to execute a tween, but have it complete before it can be triggered again? Thanks!
-
I'm triggering a tween using: highScore = game.add.tween(highScore.cameraOffset); highScore.to({ x: worldX }, 700, Phaser.Easing.Cubic.Out); highScore.to({ x: worldX + worldX * 2}, 700, Phaser.Easing.Cubic.Out); highScore.to({ x: worldX - worldX * 3},1);which tweens a 'Highscore!' message to the center of the window, off the camera, then back to the starting position. Triggering the tween I have: if (score > previousBest){ newHighScoreText(); }Nice and simple, and it works perfectlym except if I get a new highscore whilst the tween is active, it gets retriggered, messing up the animation. Is there an easy way to execute a tween, but have it complete before it can be triggered again? Thanks!
-
Hi, this may be a stupid question, but I wasn't able to find anything on how to use a P2.Body as a trigger. Maybe it's my notion of "Trigger" that is wrong. I use this term because it's called like that in Unity. I mean here a body that sends a collision event but doesn't block anything. I know I could make a rectangle and check at each update if there's an object in it, but using the onBeginContact and onEndContact of P2.Body would seems more homogenous in my system. Thanks
-
Hello! I'm founder of www.FreezingMoon.org - we're indie game developers working on an open source browser based TBS www.AncientBeast.comWe're considering adopting a game/rendering engine in order to make the game more playable on tablets and phones https://github.com/FreezingMoon/AncientBeast/issues/425 The gameplay coder has a question: Also, what's the state of documentation? Would rather see that instead of almost daily change log xD So far Phaser looks awesome, I really dig the website :-)
- 2 replies
-
- AncientBeast
- shape
-
(and 8 more)
Tagged with: