Differences in code formatting from tutorial

Updated on July 3, 2017 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
5 on June 30, 2017

Brackey’s code in his basic red cube track game has a spacing like this for his Time.deltaTime

rb.AddForce(0, 0, 200 * Time.deltaTime);

My system will only run it successfully without the spaces on either side of the multiplication symbol, like this

rb.AddForce(0, 0, 200*Time.deltaTime);

It worked fine at first dealing with the initial forward force and sideways directional keys in episode 2. However when I got to the 4th episode on camera attachment, the code I created for it failed from the start. Shortly after the first script for player movement started to bug out without any changes. Is it possible I’m on the wrong platform or script mode? I’m on updated OSX using the freeware version of Unity. Thank you much and have a good weekend! 

L

 

 

  • Liked by
Reply
3 on June 30, 2017

Those spaces shouldn’t matter at all.
Are you sure it’s not another issue?

 

on July 1, 2017

Okay, didn’t think it would be a cause but maybe a symptom of the same issue. Now no script is working. Even just trying to run “Debug.Log (“hello world!”);”  comes back in the log as multiple “Loaded assembly: /applications/unity.app/mono/   and then repeated going through all of the mono library and other application files. 

Wise
on July 1, 2017

Maybe try reinstalling Unity.

 

on July 1, 2017

Okay just tried reinstalling to no avail. No code works at all. If I try to run it in mono-editor it will flash “build successful” for a moment before disappearing and the window shifts. If I try it a second time it does not say successful and immediately starts spitting out the log I mentioned in my previous comment. Thank you for the ideas so far 🙂 

Show more replies
  • Liked by
Reply
Cancel
0 on July 3, 2017

Okay that was a silly mistake. If any other noobs ever run into this: I was using the play button at the top of monodevelop to check if my code was correct before trying to run it in unity. It works properly by skipping the play button in Mono, ctrl+save, then run it in Unity and refer to the Unity prompt for any errors.

  • Liked by
Reply
Cancel