Hey all.
I’m still fairly new to Unity but I’m cottoning on to most basic concepts at this point - having already completed the Roll a Ball tutorial and the Space Shooter tutorial. Both projects went swell and I was happy with the finished product.
I’ve recently begun the Survival Shooter project and am already having some strange problems in the third lesson component: ‘Camera Setup’.
I’ve referenced the Unity 5.x update guide and have been following it along closely. My problem is that after writing the CameraFollow script and attaching it to the Player, nothing in Game mode suggests that the script is functioning as it should. The main camera is set to Orthographic, the background is black and I’ve set it to Solid Colour. I even tested the script’s performance by deleting my coded script and copy-pasting the CameraFollow script directly from Unity’s website. Strangely, my raycast to allow the player to turn around using the mouse-pointer is not working as it should either.
The first two tutorials I followed went really fluently, so I’m a little jarred as to why I’m having issues now. My main question is - is Unity 2017.1 vastly different to Unity 5? Is the game Survival Shooter no longer able to be built alongside the tutorial posted?
Thanks in advance for any help. I’m really enjoying using Unity and want to keep going - but I’m not sure what’s going wrong this time. :\
2017.1 and 5 are different, yes. But not so different that you shouldn’t be able to go through the tutorial. If something’s not working and you don’t have any console errors, chances are you missed something you were supposed to do (like adding a script to an object or assigning a reference in the Inspector).
It kinda sucks, but go back through the tutorial again, step by step, and ensure you’ve done everything. If something is different from what you’re seeing in the video, post here asking about it and we’ll get you straightened out.
Thanks a lot for your detailed feedback. I’ve just set up the first video tutorial for Survival Shooter and I’m about to go through now and check that everything was done properly. I’ll be sure to let you know what the solution is when I find out!
Thanks again!
[Edit: check below comment for update]
Wow. Brand new day, brand new problem-solving skills.
I did as you said and followed closely a third time through the tutorials (I like to watch once, work alongside the tutorial the second time) and found the problems.
Something was wrong with my Floor quad, and I’m not sure what. I deleted my existing Floor and made it again, and the Player freely followed the mouse pointer as written in the script. I suspect it would be something to do with the raycast + floor, but unsure as to what.
Secondly, I had attached my CameraFollow script to my Player instead of MainCamera… oops. It’s amazing how I really thought I had done everything to the T, but there were a couple of errors in standing! After making these couple of changes my game is functioning the way it should at Lesson 3, and now I’m ready to continue again! ^ _ ^
Thanks for reaching out to me, the Unity community is awesome!
Have a lovely day.
You’re missing a closing brace above the ‘Animating’ method. Closing brace is like this: " } ".
Then you’ll have 1 too many closing braces after that method, so delete one
Ah okay, missed that one. There is not such thing as ‘float void’ . ‘void’ is a type and cannot be used there.
Also, I have no idea why you have "hideFlags’ or the float there, as they are not even used, it seems?
I think you want this:
void Animating (float h, float v)
Maybe your IDE auto-completed that when you tried to write or something, because of the previously bad syntax, it didn’t realize you were creating a method… I’m not sure, but try this, instead.
Now this is how you learn the right way. Nice to see somebody taking the time to go through the basics, and not be afraid to do the tedious work of restarting to find errors.
90% of the time people are crying that the engine they’ve worked in for two weeks is broken and the dev’s are lazy, or they did an hours worth of tutorials, got bored, and now are asking how to import a model into engine.