- Home /
Question by
ryan123321 · Dec 13, 2013 at 11:27 PM ·
raycastaddforcescreenpointtorayaddforceatposition
Add Force based on Raycast
Null. Error # 404
Comment
Answer by robertbu · Dec 13, 2013 at 11:29 PM
Change line 2 to:
var direction : Vector3;
direction = transform.position;
But I would suggest instead that you move the initialization into Awake() or Start();
var direction : Vector3;
function Awake() {
direction = transform.position;
}
Is there anyother way to do this because I tryed what you said and changed the 2nd line so it looked like this:
var direction : Vector3;
function Start () {
direction = transform.position;
}
Your answer
Follow this Question
Related Questions
Need help understanding ScreenPointToRay 2 Answers
Move object along ray cast using object's AddForce or velocity but not transform 1 Answer
ScreenPointtoRay Problem, how does it work!?! 1 Answer
Add force with direction 2 Answers
fire to camera 1 Answer