- Home /
Question by
SterlingStudios · Jul 13, 2014 at 02:29 PM ·
javascriptnot workingsendmessage
SendMessage Not Working: JavaScript
Hi, I have a problem I have been banging my head against for over an hour now. SendMessage is not working. I have a code of line above it EXACTLY THE SAME (exception of variable changes), and it works perfectly but not this one. Here is the code:
hit.transform.SendMessage("NewRange", newRange, SendMessageOptions.DontRequireReceiver);
And reciever:
function NewRange (newRange : int) {
range = newRange;
}
I can't do GetComponent because this is an instantiated enemy, there are more in the scene like them.
Comment
Best Answer
Answer by SterlingStudios · Jul 13, 2014 at 02:32 PM
Haha, you guys are going to punch me for this one. I was using the wrong variable...
Your answer
![](https://koobas.hobune.stream/wayback/20220613153944im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Create a prefab at a specific position(javascript)? 1 Answer
OnGUI mystically stopped rendering buttons and text. 1 Answer
Errors in script cant figure out?? 0 Answers
3d text will not display float 1 Answer