• Newly made prop can't be constrained via constraint.Ballsocket properly
    0 replies, posted
As the title implies I'm attempting to ballsocket two props which when done using two props that come with gmod (example: a 1x2 crate and a PHX sphere) works perfectly but when done with a prop of my own creation either completely fails to create a constraint (returns false) or "creates" the constraint which then proceeds to not actually work. I got around it returning false initially by using entity:activate() on the second prop (the sphere in this case) but it still doesn't work. I've also tried using other constraints like welds to no success. (Also, I've made sure that the constraints aren't breaking.) Entity initialization function: function ENT:Initialize()     self:SetModel("models/parts_tank/t3476/t3476_hull.mdl")     self:PhysicsInit(SOLID_VPHYSICS)     self:SetMoveType(MOVETYPE_VPHYSICS)     self:SetSolid(SOLID_VPHYSICS)     self:SetModelScale(24,0)     self:Activate()     local phys = self:GetPhysicsObject()     if phys:IsValid() then         phys:Wake()     end          tank_spawn_wheel(self, 0)     tank_spawn_wheel(self, 1)     tank_spawn_wheel(self, 2)     tank_spawn_wheel(self, 3)      end Wheel spawn function: function tank_spawn_wheel(ourProp, wheelNum)     local wheel = ents.Create("base_wheel")     wheel:SetAngles(ourProp:GetAngles() + Angle(0,90,0))     --wheel:SetParent(ourProp)     if wheelNum == 0 then         wheel:SetPos(relative_pos(ourProp,Vector(30,30,25)))     elseif wheelNum == 1 then         wheel:SetPos(relative_pos(ourProp,Vector(-30,30,25)))     elseif wheelNum == 2 then         wheel:SetPos(relative_pos(ourProp,Vector(30,-30,25)))     elseif wheelNum == 3 then         wheel:SetPos(relative_pos(ourProp,Vector(-30,-30,25)))     end                    ourProp:DeleteOnRemove(wheel)     wheel:SetModelScale(1,0);     wheel:Spawn()     wheel:PhysicsInitSphere(18,"rubbertire")          wheel:Activate()     local phys = wheel:GetPhysicsObject()     if phys:IsValid() then         phys:SetMass(10)     end     print(constraint.Ballsocket(ourProp, wheel, 0, 0, Vector(0,0,0),0,0,1)) -- Returns Entity [0][phys_ballsocket] in console instead of "false". Not sure what -- that zero means     constraint.Ballsocket(ourProp, wheel, 0, 0, Vector(0,0,0),0,0,1)     return wheel; end I assume I've also got some spectacularly bad coding practices in there. I'm curious if it's not finding the base or root or w/e bone that all props seem to have.
Sorry, you need to Log In to post a reply to this thread.