We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Physics Not Working Correctly?

Home Forums Bug Reports and Feature Requests Physics Not Working Correctly?

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #14471
    patrickbelt
    Customer

    Hello,

    A few months ago the physics engine was introduced to Verge3D, and Yuri showed me how to set up the drag and drop features using puzzles. At the time I was able to copy the example and make the physics work as desired. I’m now using the latest version of Verge3D: v2.12 (as well as the latest version of Blender 2.8), and am trying to use the drag and drop physics again… but now it’s not working correctly.

    In the simple example I’ve attached, if I use the “create physics body” puzzle it allows me to drag the cubes, but as soon as I let go, the cubes snap back to their original locations instead of falling straight down as intended. (Please see the attached image for the puzzle setup I’m using.)

    I tested this same puzzle logic is Verge3D v2.11-pre2 and it works as intended.

    In the actual project I’m working on, which is much larger, creating and adding any physics bodies to the puzzle logic also stops the following features from working completely: all camera tweens, all drag and drop abilities, and all hover-over functions that change the cursor to a hand or enable highlights.

    I don’t need to have physics enabled for my project, but it would be a nice addition. Please let me know if this physics issue is a glitch, or if I’m simply tired and doing something wrong :) Thanks! -Patrick

    Attachments:
    You must be logged in to view attached files.

    patrick.c.belt@gmail.com

    #14524

    Hi,

    Sorry to hear about those troubles with physics. Can you please attach here a zipped project rather than just a blend file for us to take a look? Thanks!

    Chief 3D Verger | LinkedIn | Twitter

    #14527

    Hi,

    I did check, the logic you provided should work as expected. It might be an issue with updating your project. Did you follow the procedure described in the User Manual?

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #14558
    patrickbelt
    Customer

    Alexander, in regards to my actual project, yes – I followed the updating steps as usual, and I usually don’t have an issue. The only thing I haven’t tried yet is rebuilding all the puzzles from scratch. However, before I go to that extreme, I created a new simple project to test the physics first. After doing so, I still have issues with using physics in v2.12; the two cubes snapping back into place instead of falling after dragging. Although it doesn’t illustrate some of the other issues I have related to adding physics puzzles to my main project, I believe it does show that something isn’t working correctly in regards to physics.

    Attached is the zipped file for the simple test project that demonstrates the physics issue I described in my original post above. Thanks – Patrick

    patrick.c.belt@gmail.com

    #15303
    patrickbelt
    Customer

    Hello,

    I never saw an update to the physics issue I was having. I’m now using Verge3D v2.12.5 for Blender 2.8 and am still having the same issue. I’ve zipped and attached a basic example project, and an image of the puzzle logic that it uses. In this simple example I have two blocks that stack using physics. I want to be able to click and drag either block, and then the block should drop to the plane and stay where I drop it. Instead, when I stop dragging a block, it snaps back to its original location (just like my previous example in this thread). Any help is appreciated. Thank you – Patrick

    patrick.c.belt@gmail.com

    #15309
    Crunch
    Customer

    If you turn off the physics effect on the drag start than back on in the drag drop I think you will get the effect you were looking for.

    Also, you are going to want to head back to blender, select your plane, than click object>apply scale. Otherwise, the cubes will fall right through the floor.

    #15312
    patrickbelt
    Customer

    Thank you. The puzzle example you shared did the trick. The only issue I have now is that when dragging a cube it doesn’t interact with the other cube and push it out of the way. I suppose that’s because the physics object is turned off while dragging… Do you think it’s possible to achieve this kind of object interaction while dragging, in addition to the falling object fix you suggested earlier?

    patrick.c.belt@gmail.com

    #15361
    Crunch
    Customer

    Start with the cube as a dynamic object.

    On drag start, remove the dynamic physics and assign it as an kinematic object
    On drag drop, remove the kinematic and assign it back to a dynamic object.

    #15363
    Crunch
    Customer

    Added a physics parameter puzzle so when the cube collides it will slide

    #15365
    Crunch
    Customer

    Added some hacky code which will fling the cube (applying linear velocity) a bit on the x-axis after releasing the drag – provided the object was dragged more than 1 unit across the x-axis.

    So many more experiments I would like to try but so little time ☹

    #15370
    patrickbelt
    Customer

    Wow, wow! Look at you go! Thank you so much for all of this. I’m very impressed, and appreciate the timely responses. (Although I couldn’t get the “hacky code” example to work.)

    It sounds like you’re busy, but I have one more for you if you’re interested: If I drag the red cude (bottom cube) first, the top cube doesn’t move at all. The top cube should move with the bottom cube due to friction. (I really wanted to see if I could figure this one out on my own, but after a couple hours of tinkering I have decided to reach out to you again since you seem to really know your code/puzzles.)

    patrick.c.belt@gmail.com

    #15377
    Crunch
    Customer

    Oh I am always up for a challenge. I haven’t spent much time with physics in Verge (even though its so much fun!) but after a couple of experiments today, I got this one working.

    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:bddc09b7fe/applications/cubefriction/cubefriction.html

    Staying along the lines of the other example I showed you, I initially tried to see if I could quickly cycle (using a loop with a clock) between a kinematic object (which can be grabbed in drag event) and dynamic object during the “move” event of the dragged over puzzle, and see if that added any stickiness/friction between the cubes. That failed.

    To have interactions (physical interactions) between two dynamic objects, I don’t think you can ‘touch’/interfere with them. So, what I ended up doing, was to tie a conventional (no physics applied) cube (with a drag move event) to apply force on the blue cube corresponding to how far, and in what direction the conventional cube was dragged.

    See the attached puzzle. The conventional cube (cube.002, or the “ghost cube) is slightly bigger than the blue cube (cube) and it’s position is set by a ‘every frame’ puzzle to match the blue cube. It also has a transparent material so you can’t see it. Click on the button in the upper left corner toggle between a transparent and translucent material on the ghost cube to see what is going on.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.