Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
i want do something when mesh2 get close to mesh1,my code as follow: engine.ingComplete = function() { var scene = engine.getScene(); if (scene) { // find the cube scene node cubeSceneNode = scene.getSceneNodeFromName('cubeMesh2'); var cm1 = scene.getSceneNodeFromName('cubeMesh1'); var testf = function (){ alert("aaaaaaaaaaa"); } var animator1 = new CL3D.AnimatorOnProximity(scene,150,cubeSceneNode.Id,testf,false); cm1.addAnimator(animator1); // also, force the 3d engine to update the scene every frame scene.setRedrawMode(CL3D.Scene.REDRAW_EVERY_FRAME); } } but,it did not work. i want to know why and a well working example. thanks a lot. |
||||
|
Hm, I can't see why that shouldn't work, not sure here. I'll take a closer look at this soon. |
||||
|
I'm having a similar issue. In CopperCube I set proximity events on objects, but they don't seem to do anything when published to CopperLicht. A couple examples: I created a ground surface (a large flat cone) and to keep from running off the edge and falling into a void, I created a fence around the perimeter. Whenever I would to the edge I'd get stuck to the fence and be unable to move off it. So I set a proximity event to the fence so that if I got too close it would transport me to <0, 20, 0>, 20 units above the center of the scene. With the proximity event nothing happened. I attached the event to a keypress but it only transported me 20 units straight up and I was still stuck. I created an archway in 3DS Max and used a plane as a curtain over the opening of the archway. I set a proximity event on the plane so that if I ran into the plane it would open a new browser window (as a test). Nothing happens. |
||||
|
I'm having a similar problem to this. I have a player and when he walks into a hole in the ground he will land on a upside down spinning cone. When this happens I want him to spin, but the function is never called. My function is like this: engine.ingComplete = function() spin() just increases the player's Y rotation value. |
||||
|
|
||||
|
wrote: I attached the event to a keypress but it only transported me 20 units straight up and I was still stuck. That's because with the collision response behavior attached to you, you can't go through walls. wrote: I have a player and when he walks into a hole in the ground he will land on a upside down spinning cone. When this happens I want him to spin, but the function is never called. This is a bug in CopperLicht, the function really is actually never called. Will be fixed in the next update. In the meantime, you can patch CopperLicht with your code yourself: Each AnimatorOnProximity has a function named 'invokeAction'. It gets called to trigger the function. You can simply set it to your function and it should work, like yourAnimator.invokeAction = spin. |
|