x


Setting off animation with trigger

Im trying to figure out how to make doors open when a trigger is hit. So i shoot a button and it opens one door. Then a different button sets off a different door animation. If not willing to tell me how....could you at least point me in the direction of a good tut. Thanks.

more ▼

asked Jul 15 '10 at 03:11 PM

Karl Kujak gravatar image

Karl Kujak
71 12 12 16

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

1 answer: sort voted first

If you have door animations then use for the button something like

var door : GameObject;

function HitByBullet() {
 door.animation.play("open")
}

When you determine that the button has been hit, call the HitByBullet function.

If you haven't figured out how to tell if the button was hit yet, check the scripting reference for OnTriggerEnter, OnCollisionEnter, and Physics.Raycast; one of those should make you happy.

more ▼

answered Oct 09 '10 at 03:18 AM

Loius gravatar image

Loius
10.9k 1 12 43

(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:

x3935
x1020
x330
x200

asked: Jul 15 '10 at 03:11 PM

Seen: 1362 times

Last Updated: Jul 15 '10 at 03:11 PM