x


Collision between player and a ball

Hi guys,

i've a problem. I've very little experience in programming in unity, and this is my situation:

i've a simple game were now there is only a plane with a character on it. I want to add some sphere floating to him, and he can hit them, changing there direction (sorry for my english =) ).

for starting, if anybody can help me, is enough to be able to put a sphere near the character that reacts to collision with him.

tell me all about the setting about rigibody, collider and so on, i'm in your hand! =)

Thanks all!

more ▼

asked Mar 04 '11 at 03:52 PM

MatteGary gravatar image

MatteGary
2 1 1 1

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

1 answer: sort newest
     function OnCollisionEnter(other : Collision) 
     { 


     if (other.gameObject.name == "floor1") 
 { 
     print("Game Over");
 } 

     if (other.gameObject.name == "floor2") 
  { 
     print("Game Over1");
     } 

}

more ▼

answered Mar 04 '11 at 03:56 PM

robert 4 gravatar image

robert 4
396 13 16 27

for managing the collision detection this is good, but first I need to know how to show the ball moving towards the player, and which settings give the player and the balls to make sure that if they bump, they change direction (the balls) ...

Mar 05 '11 at 01:03 PM MatteGary
(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:

x2500
x1877
x1793
x198

asked: Mar 04 '11 at 03:52 PM

Seen: 1128 times

Last Updated: Mar 04 '11 at 03:52 PM