- Home /
Script only working in editor
A script that I copied from a tutorial only works when it is being run inside the editor. When I export it nothing happens. (the script is for moving platforms)
Here is the script:
var targetA : GameObject; var targetB : GameObject;
var speed : float = 0.1;
function Update () { var weight = Mathf.Cos(Time.time speed 2 Mathf.PI) 0.5 + 0.5; transform.position = targetA.transform.position weight + targetB.transform.position (1-weight); }
What is going wrong?
Please when putting code into a post, wrap the code in code tags.
Answer by jonas-echterhoff · Jan 23, 2010 at 02:49 PM
while I can't see anything wrong with the script, it is probably a good idea to check the player log files to see if there are any error messages. See the docs for the location of the player log (when running in a web player).
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How do I break apart an object? 2 Answers
Preview Object motion 1 Answer
EditorApplication.update resetting 3 Answers
Raycast length must be equal to the target distance 2 Answers