|
how do you SendMessage to another object? i am trying to send addAmmo from a box on collider enter with the Player, for some reason i can only recieve the message on scripts attached to the player i want to go to my Gun. var ammo = 20; function OnTriggerEnter (collision : Collider) {
i get the Debug |Log so its workin'... function addAmmo (ammo : float) {
} however this dosent.
(comments are locked)
|
|
Do you mean that the message is sent only to the Player object, and you need it to propagate down the object hierarchy to your gun object??? If so, you want to use BroadcastMessage instead of SendMessage (with the same parameters).
(comments are locked)
|
|
Since you're assigning an integer to your ammo variable I suspect the
(comments are locked)
|
|
Put this on the ammo box (in a collision check): if you read above that is what ive done however it is in the receiver where i have the problem
Dec 27 '10 at 09:10 PM
Mike Ledwards
(comments are locked)
|
