I’m new and I’m working my way through the Scripting Tutorial.
I’ve got a few things not working and I can’t figure why.
First the spotlights appear to be scripted correctly but aren’t showing up in the Game. The little sun gizmos are there but they do not emit light.
Second. With the Switch script I get an error saying the Input Button Jump is not set up and go to Project prefs but when I do it is.
(Default - spacebar)
The initial spotlight is a bit deceiving because it is shining at you, it is hard to see it in first person mode. Try to position it somewhat high, and ‘behind’ you, like on -z axis. This way when it shines on you, you will see the circle of light around where your feet should be.
As far as the space bar thing, make sure you are using quotes for “Jump” and if you could, paste your script so we can see exactly where the error might be.
Right. Moving the light as you described has helped me see what the problem is and that is now fixed. Thanks!
The script for the Jump error problem is:
[var switchToTarget : Transform;
function Update () {
if (input.GetButtonDown(“Jump”)
GetComponent(Follow).target = switchToTarget;
}]
And the error I get is: UnityException: Input Jump Button is not set up. To change the project settings etc" But when I go to the project settings it’s fine.
The Instantiate script works fine except all my cubes are appearing behind the camera and I can’t work out why.