Elmatus Posted January 16, 2016 Share Posted January 16, 2016 Thanks in advantage for any help The problem is kind of simple, yet I haven't figured it out yet. I want that the barrels created actually move and fall. It only happens when a player touches it. The wiki says that to implement physics in an object just set velocity to 0, but it doesn't work A snippet of the code: function .... if.... for i,spot in ipairs (spots) do local pos = split(spot,",") if objectType == "object" then local theObject = createObject (object,pos[1],pos[2],pos[3]) setElementVelocity(theObject,0,0,0) elseif objectType == "vehicle" then local theVehicle = createVehicle(object,pos[1],pos[2],pos[3],math.random(0,120),math.random(0,120),math.random(0,120)) addSpeed(theVehicle) end end end end Link to comment
tosfera Posted January 17, 2016 Share Posted January 17, 2016 I haven't had this problem before yet, but try to set the velocity to 0, 0, 0.1 and right back to 0, 0, 0 again. It should gain it's physics. Another thing you can do is delay the velocity a little bit with a timer of 50ms. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now