Jump to content

Created Barrels doesn't have physics


Elmatus

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...