Yue Posted June 15, 2019 Share Posted June 15, 2019 have a problem, when the player takes a box to transport it the shape assigned to that box is removed, and the mass is set to zero. Now, when you release the box, you assign a shape again, but this does not match the size of the box, it is much bigger, any suggestions please? --## Acction Objects. function this:AcctionsObjects() if self.ray then if self.pickInfo.entity:GetKeyValue("name") == "Cajas" then if Window:GetCurrent():KeyDown(Key.E) then if self.acction == 0 then self.pickInfo.entity:SetDamping(0,0) self.pickInfo.entity:SetOmega(45,45,45) self.forceKick = Vec3(0,0, 500) self.forceKick = Transform:Vector( self.forceKick, self.player, nil) self.pickInfo.entity:AddPointForce( self.forceKick,self.player:GetPosition(true)) else if self.itemBox == false then self.pickInfo.entity:SetShape(nil) self.pickInfo.entity:SetMass(0) self.pickInfo.entity:SetParent(self.player:FindChild("ItemCabeza"),true) self.pickInfo.entity:SetPosition(0,0,0) self.pickInfo.entity:SetRotation(0,0,0) self.pickInfo.entity:SetPickMode(0) self.acction = 0 self.itemBox = true self.box = self.pickInfo.entity Window:GetCurrent():FlushKeys() end end end end else --## Shoot Box. if self.itemBox == true then if Window:GetCurrent():KeyHit(Key.E) then self.box:SetParent(nil) self.box:SetPickMode(Entity.BoxPick) self.shapeBox = Shape:Box() self.box:SetShape(self.shapeBox) self.shapeBox:Release() self.box:SetMass(2.0) Window:GetCurrent():FlushKeys() end end end end Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted June 15, 2019 Solution Share Posted June 15, 2019 The Shape::Box() command takes additional paramters for offset, rotation, and scale. 1 Quote 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
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.