x


Player Bumps Objects Over

Hi, I'm new to Unity. I'm not seeking to make a game at all, just a simple application so I can walk around in FPS perspective and view my 3ds max scenes. I'd like to have a bit of physics though. I have applied a Rigid Body to my meshes. Problem is, I would like them to fall over if the mass is low (or high?) enough. So can someone make a quick script that makes the object fall over when the player collides with it? I am using the FPS controller asset that comes with Unity 3.

more ▼

asked Aug 05 '11 at 04:06 AM

rapidfireshot gravatar image

rapidfireshot
-19 1 1

First off, don't reply to answers with more answers. Second, I've retagged your question with "write-my-code" in the hopes that nobody will ever find it.

Aug 08 '11 at 11:19 PM Jason B
(comments are locked)
10|3000 characters needed characters left

2 answers: sort newest

Ok, I'll try this immediantly. I already had rigidbody's for the meshes, I'll go and add one to the FPS camera child.

more ▼

answered Aug 08 '11 at 10:36 PM

rapidfireshot gravatar image

rapidfireshot
-19 1 1

(comments are locked)
10|3000 characters needed characters left

What you are asking is actually easy, but can't be performed with a script that one would be able to cut & paste here.

What you need is basically to:

1- create a gameobject as a child of the main camera
2- attack an fps controller and a rigidbody to the object (so that it has physics). the controller is part of the standard assets.
3- import your scene in the form of meshes and drag them into the scene
4- assign rigidbodies to each of the objects you desire to collide with, and tweak their physical parameters. The tricky part here is that you most surely need to create a script that detects a Collider Hit, to apply a force, that you need to attach to both player and objects
5- bump away
more ▼

answered Aug 05 '11 at 09:35 AM

roamcel gravatar image

roamcel
1.2k 37 40 44

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x132

asked: Aug 05 '11 at 04:06 AM

Seen: 429 times

Last Updated: Aug 08 '11 at 11:19 PM