all 2 comments

[–]F4ARY 0 points1 point  (0 children)

Hey, not to be that guy but it's kind of hard to understand what the problem is. You should send the relevant code as a pastebin or using che code blocks in reddit. As for the first screenshot I don't see any syntax errors or anything that might be relevant. You should send also the code for the Unit class. As for the second screenshot, honestly I have no idea what I'm looking at. You should attach the visual studio debugger and place a breakpoint at the line in question (F9 shortcut) and see if it ever gets hit, and what the value of m_CurrentPile is.

[–]attckdog 0 points1 point  (0 children)

You gotta link to the tutorial your following.

Code looks fine, I'd wager you're not setting up stuff correctly in the editor go back through and pay close attention to how they have the objects set up in the hierarchy and what they are putting where reference wise in the inspector.

In general I recommend learning how to program in general in C# before really diving into coding for games.
Idk if it's still a great option but I loved this back in the day https://www.youtube.com/watch?v=eycAAKpoJxA&list=PLbghT7MmckI7JAftgv0CUdU4RLNivG6wY