Alienhead Posted September 10 Share Posted September 10 I'm workind with a smaller scale than the normal character controller initializes at. Being so, all my collisions are off, meaning I interact with objects well before I should be due to the fact my character scale is smaller than the normal. I don't suppose theres a way to adjust character controller bounding box? or perhaps a custom shape ? Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted September 10 Author Share Posted September 10 Next question is, "whats the current state of createhingejoint?". I'll borrow some code from UAGC to demonstrate. self.entity:AddTag("UAGC:Rope") self.entity:Move(0,.5,0) self.base = self.entity self.child = {} self.joint = {} self.box = {} self.knot = {} self.tmr = Millisecs() + 100 table.insert ( uRope, {ent = self.enttiy}) local last for t=1, self.segs do self.child[t] = CreateCylinder(world) self.box[t] = CreateBoxBrush(world) self.box[t]:SetCollisionType(0) self.box[t]:SetScale(.1, self.height, .1) self.child[t]:SetScale(self.width, self.height, self.width) self.child[t]:SetColor(1, 1, 1) self.child[t]:SetPosition(self.entity:GetPosition()) self.child[t]:Move(0,-self.dist*t,0) local mass = 2 self.child[t]:SetMass(mass) self.child[t]:SetColor(.5,.5,.5) self.knot[t] = CreateSphere(world) self.knot[t]:SetScale(self.width*3,self.width*3,self.width*3) self.knot[t]:SetScale(.01,.01,.01) self.knot[t]:SetCollisionType(0) self.knot[t]:SetPosition(self.child[t]:GetPosition(true)) self.knot[t]:Move(0,-self.height/2, 0 ) self.knot[t]:SetParent(self.child[t], true) self.knot[t]:SetColor(.5,.5,.5) self.box[t]:SetPosition(self.child[t]:GetPosition(true)) self.box[t]:SetParent(self.child[t], true) self.box[t]:SetHidden(true) if t == 1 then --self.joint[t] = CreateHingeJoint(self.base.position, Vec3(1, 1, 1), self.base, self.child[t]) self.joint[t] = CreateBallAndSocketJoint(self.base.position, self.base, self.child[t]) else --self.joint[t] = CreateHingeJoint(last.position, Vec3(0, 2, 0), last, self.child[t]) local apos = Vec3(last:GetPosition().x, last:GetPosition().y- (self.height/2), last:GetPosition().z) self.joint[t] = CreateBallAndSocketJoint(apos, last, self.child[t]) end --self.joint[t]:SetFriction(111250) self.joint[t]:SetLimits(15,360) --self.joint[t]:SetLimits(-1000,90) self.child[t]:SetPickMode(0) self.box[t]:SetPickMode(0) self.knot[t]:SetPickMode(0) last = self.child[t] end self.bulb = LoadModel(world,"models/misc/bulb/lightbulb.mdl") self.bulb:SetPosition(last.position) self.bulb:Move(0,-self.height/2, 0 ) local apos = Vec3(last:GetPosition().x, last:GetPosition().y- (self.height/2), last:GetPosition().z) CreateHingeJoint(apos, Vec3(0, 0, 1), last, self.bulb) end This code creates a rope, jointed together. That all works great. When I go to attack an object to the end of the rope it falls immediately off. Shouldnt CreateHingeJoint() hold the object in place since im attaching it to a parent ? PS The code above does not add a mass to the bulb, but I've corrected that and still the same results. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted September 10 Author Share Posted September 10 Last problem - A bit of a problem, I have this table mesh with a collider attached to it. But I get no collisions, my character controller falls to the terrain as well as anything else sitting on the table. Why wont this object pickup collision ? Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.