Search Issue Tracker
Fixed in 5.4.0
Votes
0
Found in
5.0.1f1
Issue ID
750066
Regression
Yes
[javascript] crashes when using GetComponent.<Transform> when declaring variable
Unity crashes when in javascript's variable declare user tries to assign value using GetComponent<> function.
Crash only happens if script is used in prefab.
Steps to reproduce:
1. Open attached project.
2. Open the scene
3. Try adding NPCTick.js script (Assets/NPCs) to Player prefab (Assets/Player)
4. In the inspector, press apply button
5. Unity crashes.
Regression from 4.6. In 4.6 there was an error thrown:
"UnityException: You are not allowed to call this function when declaring a variable.
Move it to the line after without a variable declaration."
Reproduced with 5.0.1f1, 5.3.0f3.
Fix verified on 5.4.0b16
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Linux] TMP Font Asset pop-up Window opens on the secondary monitor when the Editor is placed in primary monitor
- Transition delay is ignored when opacity is listed before scale in transition-property of the Styles.uss file
- “NullReferenceException” error thrown in the Console when pressing kebab button in Pipeline Specific Settings for Default Profile in Project Settings window
- [Silicon] Crash on os_unfair_recursive_lock_lock_with_options when opening a project while the Razer Synapse app is open
- Build fails with a warning when running Unity Editor’s csc.dll manually using dotnet command
Add comment