|
I'm a beginner in Unity 3D and i need help with creating a script. Here's how it should work. When i click the button 'Flashlight', the GameObject 'Flashlight Real' should be enabled. If the GameObject is already enabled, it should do the opposite. So how do i create this script?
(comments are locked)
|
|
See this similar Question/Answer. I added the code but i get an error message - Assets/Standard Assets/Scripts/Flashlight Button.js(1,6): UCE0001: ';' expected. Insert a semicolon at the end. There is a semi-colon at the end Light myLight = lightPoint.GetComponent("Flashlight Real");
May 12 '10 at 02:45 PM
TheTechZone
The snippet posted is in C#.
May 12 '10 at 03:01 PM
burnumd
Also, you need to put the if expression inside Update (or similar).
May 12 '10 at 03:04 PM
burnumd
(comments are locked)
|
