Jump to content

Scale Shape?


Go to solution Solved by Josh,

Recommended Posts

Posted

 

image.png.f43483bfc5083d22fe1b14463b834acc.png

 

image.png.6a76185e2f4fc28107da1a5876f2d3a3.png

 

 

 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

 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...