tipforeveryone Posted January 11, 2018 Share Posted January 11, 2018 function Script:Start() local box = Model:Box(0.5,0.5,0.5) box:SetPosition(0,4,0) box:SetMass(1) box:SetCollisionType(Collision.Prop) local pos = box:GetPosition(true) local joint = Joint:Ball(pos.x, pos.y - 1, pos.z + 1,box) --This makes sure that box has high velocity after dropping joint:SetFriction(200) end And I got this, I think there is a problem with Joint:Ball (and Joint:Hinge - I tried too) of velocity and gravity interaction Link to comment Share on other sites More sharing options...
tipforeveryone Posted January 12, 2018 Author Share Posted January 12, 2018 What is wrong, anyone has any idea ? This is not physic anymore when your object spins around like this Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 12, 2018 Share Posted January 12, 2018 Maybe the mass is too low? For the ropes I use a mass of 10. Link to comment Share on other sites More sharing options...
Thirsty Panther Posted January 12, 2018 Share Posted January 12, 2018 I'm no expert but aren't you moving the joint to give your box its momentum. If you look at the example in the documentation you set the joints position then apply Torque to the object to get it to rotate. If you remove the Y component in your script the box swings. If you add to the X component with no Y or Z the box swings. Is this the behavior you are looking for? Link to comment Share on other sites More sharing options...
tipforeveryone Posted January 13, 2018 Author Share Posted January 13, 2018 On 1/12/2018 at 2:19 PM, AggrorJorn said: Maybe the mass is too low? For the ropes I use a mass of 10. SetMass(10) even (100) is no use, my box still spin around the joint like crazy this video I made a simple joint:ball with a light which has the same code and it worked properly (LE4.1 with old Newton) You can see the diffirence. On 1/12/2018 at 2:55 PM, Thirsty Panther said: I'm no expert but aren't you moving the joint to give your box its momentum. If you look at the example in the documentation you set the joints position then apply Torque to the object to get it to rotate. If you remove the Y component in your script the box swings. If you add to the X component with no Y or Z the box swings. Is this the behavior you are looking for? I did not move the joint, i let it stay still, and I dont want to addTorque, just leave it there, then I can simulate a hanging target to shoot. I wonder why Josh does not pay any attention Link to comment Share on other sites More sharing options...
Thirsty Panther Posted January 13, 2018 Share Posted January 13, 2018 local joint = Joint:Ball(pos.x, pos.y , pos.z + 1,box) When I use the above code I get the result you are after. Or if you use local joint = Joint:Ball(pos.x+1, pos.y - 1, pos.z,box) If you +1 or -1 the Y variable it goes crazy. Link to comment Share on other sites More sharing options...
tipforeveryone Posted January 13, 2018 Author Share Posted January 13, 2018 27 minutes ago, Thirsty Panther said: local joint = Joint:Ball(pos.x, pos.y , pos.z + 1,box) When I use the above code I get the result you are after. Or if you use local joint = Joint:Ball(pos.x+1, pos.y - 1, pos.z,box) If you +1 or -1 the Y variable it goes crazy. Yes it is, the reason I use "pos.y - 1" is that will make the box become higher than Joint position so when the box falls down, it will have enough velocity to traverl at least 1 round. the bad thing is its velocity was NOT decreased by gravity, and it become bigger and biger, thus it spin like hell. if you only use pos.z + 1, you can see the box will move forever, and if you use box:AddForce(--with a big force vector--) that box will go crazy again. It feels like mass and friction is nothing in leadwerks Link to comment Share on other sites More sharing options...
Thirsty Panther Posted January 13, 2018 Share Posted January 13, 2018 OK I see now. Your right in that it will keep swinging. Link to comment Share on other sites More sharing options...
tipforeveryone Posted January 13, 2018 Author Share Posted January 13, 2018 11 minutes ago, Thirsty Panther said: OK I see now. Your right in that it will keep swinging. That's the point. It seems to be no fix for that now. How can Josh ignore this? Link to comment Share on other sites More sharing options...
Josh Posted January 14, 2018 Share Posted January 14, 2018 Hold on... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 14, 2018 Share Posted January 14, 2018 Reported here:http://newtondynamics.com/forum/viewtopic.php?f=12&t=9203 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts