Jump to content

Transporting a box


Yue
 Share

Recommended Posts

The biggest problem is, to put aside my perception of things and understand that it's just a game, as Johs mentioned, physics doesn't have to be real, it's just a game, but sometimes I have the craze that everything has to be as real as possible and this slows down the project, its goal of making a video game.

So here I am again, asking for your help to be able to pass this challenge successfully.  And my player already carries a box, in the head, of course an animation will be made to make it look better.
 

Now the thing is, I want to use a single key for the player to interact with the scenario, the boxes and other elements, but initially I have the key that kicks the boxes, the E key, and I would like to know if there is any way for this key to react to kick the box and at the same time take the box, and then leave it. 

I appreciate the suggestions.

local cajaT = false
function Script:Collision(entity, position, normal, speed)

	if cajaT == false then
		 
		if entity:GetKeyValue("name") == "Caja" then
			entity:SetMass(0)
			entity:SetShape(nil)
			entity:SetKeyValue("name","TCaja") 
			
			entity:SetRotation(self.entity:GetRotation(true))
			entity:SetParent(self.entity)
			entity:SetPosition(0,12,0)
			cajaT = true
		end 
	end 


end



 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...