Hi all. I have not used Unity or done any game dev in about a year. I reinstalled everything on a new computer looking to get started on a project.
I installed Unity Hub. Via this I installed Unity 2020.3.0f1 (perhaps important I’ve installed the Unity editor and my projects on E: which is Nvme).
I took the visual studio 2019 that comes with Unity installer.
On creating a new project the only thing I’ve changed is the ‘External Apps’ part In Preferences to be Visual Studio (it was default to devenv).
I create a cube named player. I create new cs script named PlayerMovement.cs and attach it to player as a component.
I’m not at my pc so can’t copy the exact script. But i leave it as default and add any variable eg. public float Speed;
This is the first problem. That variable never serialize in inspector. The weird part is if I then click ‘New Component’ and create a new script named somedumbname.cs , the PlayerMovement script then serializes. Annoying but I carried on using this workaround. But then any changes I make to the movement script from now still don’t work. I have to delete the dumb.cs and do it again.
The second problem is even if I don’t add any public variable. If I just write this line in Start()
Debug.Log(“player movement script started”);
Then log never appears. Unless I do that dumb.cs trick as mentioned above.
I tried uninstalling vs 2019 and Unity. When I reinstalled it appeared to remember some of my changes ie. The colour tint I set for entering playmode.
There appears to be no error or warning at anytime when opening Unity or compiling the code.
Please help me as I really wanted to put some hefty hours into my new game idea this evening.
Thanks and I appreciate the help. But I have read the output logs and as I say it is all a default new project. The only thing I add is the public variable and or the debug line.
There are no errors in the script i have made absolutely sure. Also like I say if I add a random new script to the same GameObject all the changes then pull through and populate in the inspector and also work correctly. Subsequent changes are ignored by unity until I do the same voodoo with the adding new script.
When I’m home in hour or so I’ll record short video yo explain it