matriax's Recent Forum Activity

  • The "execute javascript" for mesh works, the thing not works is change the visibility of the mesh.

    I tried to change the visibility of a mesh picking by UID using the Babylon3D actions but nothing happens for OBJ-Mesh objects. On NewMesh objects works.

    I tried to erase a mesh picking by UID using the execute javascript and works perfect:

    "this.runtime.scenes[0].getMeshByName(""mesh35"").dispose() ;"[/code:10irrxbk]
    
    Seems the problem is the "visibility" action for OBJ-Mesh ¿?. Or why works on NewMesh and not on OBJ.Mesh?
  • Found this when i tried to parent a NewMesh to the camera:

    ---

    EDIT2 - Y.rotation solved!!

    In the post about avoid the Y.rotation Deltakosh posted this example:

    http://www.babylonjs-playground.com/#GZ1YB

    (thread: http://www.html5gamedevs.com/topic/2774 ... n-on-move/)

    The thing that avoid the Y to fly is this:

        camera._updatePosition = function() {
            this.cameraDirection.y = 0;
            this.position.addInPlace(this.cameraDirection);
        }[/code:3qdr3eei]
    
    In execute javascript seems with only this already works:
    [code:3qdr3eei]"this.runtime.scenes[0].getCameraByName(""camera"").cameraDirection.y = 0;"[/code:3qdr3eei]
    
    This can be done actually with the Babylon3D actions? I tried some of them adding Y to 0 but none worked or this is another expresion? In that case will be great have the DIrections X/Y/Z for the next update with all the other minor fixes with camera degress,etc...
  • X3M Maybe it's me, but i'm trying adjust X/Y/Z coordinates and seems for each action i want to do even for the same plugin they changes.

    I was trying to set a bullet in front of the camera and for clone mesh the X/Z works in a way and for set position in other. In both cases the bullet appears in front the camera but for each action the axis works different?.

  • X3M Waiting the video tutorial to see real examples working :S .

    So seems for the Light and Mesh objects they refer to the UID: Light4, Mesh21,etc... but for the camera uses the mesh name in the left tab, not the C2 name, the one that uses Babylon that appear above "Scene ID".

    I have the Light thing working now, on press I > Light2 to 0.0 intensity and the execute javascript works this:

    "this.runtime.scenes[0].getLightByName(""light2"").intensity= 0.0;"[/code:3f0v4518]
    
    But the mesh still not works. I have NewMesh objects and OBJ-Mesh and tried:
    "this.runtime.scenes[0].getMeshByName("&"'mesh20'"&").visiblity = 0.5;"
    "this.runtime.scenes[0].getMeshByName("&"'mesh24'"&").visiblity = 0.5;"
    "this.runtime.scenes[0].getMeshByName("&"'mesh27'"&").visiblity = 0.5;"
    etc.... But none worked.
    
    The camera seems is detected but when i try to apply your javascript code i get this error:
    [img="https://i.imgsafe.org/e43794988e.png"]
    [code:3f0v4518]"this.runtime.scenes[0].getCameraByName("&"'Camera'"&").position += 1.0;"[/code:3f0v4518]
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The first example works perfect, the other don't, maybe because they have a "" ?

    Example

    Browser  |Execute javascript "this.runtime.scenes[0].getMeshByName("mesh3").visiblity = 0.5;"[/code:bmh9wjyv]
    
    I created a NewMesh = Cylinder, with Cylinder as object name and mesh name. This Cylinder have UID=27 on C2.
    
    I tried this:
    [code:bmh9wjyv]"this.runtime.scenes[0].getMeshByName(""Cylinder"").visiblity = 0.5;"[/code:bmh9wjyv]
    [code:bmh9wjyv]"this.runtime.scenes[0].getMeshByName(""Cylinder""+27).visiblity = 0.5;"[/code:bmh9wjyv]
    [code:bmh9wjyv]"this.runtime.scenes[0].getMeshByName(""Cylinder""27).visiblity = 0.5;"[/code:bmh9wjyv]
    [code:bmh9wjyv]"this.runtime.scenes[0].getMeshByName(""Cylinder+27"").visiblity = 0.5;"[/code:bmh9wjyv]
    
    But none worked.  I added double "" to get working if not i get an error syntax on C2 expressions. How have to be done correctly? What i'm missing?
  • X3M I posted the FreeCamera problem on the Babylon.js forums here:

    http://www.html5gamedevs.com/topic/2774 ... n-on-move/

    Hope somebody finds a solution or a way to fix it, i tried in all ways i know and never get the behaviour desired, also i want to create some kind of switch to deactivate/activate and use it as Walk/Jetpack.

    ---

    About use babylon.js functions on C2, how optimized/fast will be compared with the babylon3D plugin? I mean, the same function using Babylon3D action or executing Babylon.js functions in events have any difference?

  • matriax There is no automatic optimization unless you assigned the Scene Optimizer behavior to the scene.

    Oh you're right! Seems i added that in the old versions and forgot it :S .

  • I think i know how have to be done, using function with the browser plugin to "execute javascript" ? .

    So i guess we will have to import the Babylon.js to our project and call the babylon.js functions with the "execute javascript" action of the Browser plugin.

    Still don't know how exactly have to be done, some dropbox examples i found are missing, but if you can provide a youtube tutorial and the .capx file showing with some events calling functions for scene, camera,etc.... will be awesome! .

    ---

    X3M In this Babylon.js or Babylon3D seems there is some automatic optimization when detects some framedrops that makes the render some pixelated. For example if i'm running the NW.JS and i do another thing that can make the render slow that cause for X seconds a frame rate under 45 FPS(or something like that) automatically babylon set a 2x pixelation, and if continues a 3x, or 4x....

    Is there anyway to deactivate that?

  • matriax You can already execute BabylonJS code in C2, I'll post a tutorial on youtube later.

    X3M WHAT? XD , where is the action? how i miss that! :O , Was announced in an old post or something? I'm trying to see but in the Store page still appears the 0.5 as last features and in the first page here in the forums i can't see nothing like that.

    ---

    EDIT:

    I can't find nothing, so maybe the way to add babylon.js is a bit tricky?

    When you say execute Babylon.js code you mean adding it in the C2 events or by editing external things like the .js? Maybe "Set from JSON", using "execute javascript" or loaded by a .babylon scene file?... Waiting for that tutorial!

  • matriax Target camera does not have an ellipsoid. Each camera has its own parameters.

    And how can we know that? In the description camera will be great some advices like that, or simply make Babylon not take in consideration the ellipsoid when Target Camera is added to avoid the error.

    BTW, the TargetCamera was for fix the FreeCamera problem when you fly, but with target camera seems we have to build our own controls for movement and camera rotation(for mouse). And also, without ellipsoid how the camera check the collisions? Also the gravity not works with targetCamera...

    So, in my opinion better find a solution/fix for the FreeCamera to avoid fly, instead of build from 0 all the behaviour in Target Camera.

    Any ideas?, Maybe by code in the plugin some action in the camera to switch if the FreeCamera take or not the Y.rotation in consideration? So if deactivated you walk etc... and with that active you can fly or use it as a "JetPack behaviour".

    ---

    Other thing i'm wondering is, will be possible add in the plugin some action to use native Babylon.js code? So i can ask in the Babylon.js forum for a solutions and paste it on the events. Maybe is something impossible, just asking.

    EDIT

    For example i searched in their forums how to solve the problem and found this:

    http://www.html5gamedevs.com/topic/1881 ... p-or-down/

    So with an event to use native Babylon.js code i can try that solutions in case i can't fix myself with the babylon3D plugin.

  • X3M I simply open your FPS template, change the FreeCamera by Target Camera and get the error. just that. i told you in the other post, here the image of the error:

  • X3M Tested better the collision, destroy mesh and other things and glad now it works with duplicates and families, this make the work lots easier. BTW, If for the new update you can add the possibility to destroy any Mesh at the intersect condition will be great. Looks like on interesct condition the first mesh is prepared for something but when you try to destroy/interact with another turns crazy or something.

    Also there is no way to do: When camera collides with a mesh > destroy the mesh . Or at least i was unable to do it.

    ---

    Back to the camera thing, what happens to the TargetCamera? I'm doing some wrong or the Target Camera is a real bug?

    I'm going to try fix the FreeCamera Y, now that i know takes the Yrotation in consideration if not i will pass to other things.

matriax's avatar

matriax

Member since 22 Jun, 2015

Twitter
matriax has 114 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Viral Game One of your games has over 100,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies