I am working through the book at the moment. I am getting an issue where with BobbleHead Wars my body and head does not move together. The further I move the further the head goes ;). Also firing my bullets does not work. This is from following the tutorial and doing everything myself. Backtracked to see if I missed something but all matches up.
Anyhow, I then tried to run the completed code example to look for differences/my issues. Unity crashes when I opened the example in version 5.5.2f1 as it was made using Unity 5.5 earlier version.
It seems to be a mission with Unity when there is a new version that all goes haywire. Is this normal?
Hi Herman … Welcome to the joys of Unity! Each version tends to introduce its own inconsistencies. This is why games tend to stay on one version and if they upgrade the project to the latest version, it’s kind of a big deal.
That said, it looks like you are running into issues with Physics. It’s hard to diagnose the head issue. It sounds like your head is not parented to the Space Marine GameObject. If you can, please take a screenshot of the Hierarchy and post it here.
Regarding the bullets firing, my guess is that they are colliding with the player’s collider and thus being destroyed. To really determine if the firing method is being called, print out a log statement. That way, you’ll know if the code block is being correctly called. If log statements aren’t being generated, then you’ll need to check the are where the code is being called.
Give it a look over and let me know what you find. Cheers!
I came across the same issue with the head moving further away from the body when moving through the arena. I almost left it that way to move on with tutorials and having the final and starter chapter files I thought well I have a fixed version for the next chapter. Then I thought, no I have to address the issue as a learning example because I wanted to know why or what was causing it. So I went back to the beginning of the chapter and started reviewing. What I found was (not sure how it happened, but then when re-doing I had two for some reason) the issue I found was when BobbleMarine-Head is selected Hierarchy, in the Inspector, in the Components section there was a component called Player Controller (Script) with a value of 50 in the Move Speed that once I unchecked the component to make inactive the head moves with the body just fine. Luckily I did not delete to have it for future reference just in case situation.