Robot Rampage, player not staying on ground

Hi,

I’m a few pages from completing the Robot Rampage tutorial and everything is working beautifully except when the player gets close to the robots and somehow player gets lifted up.

I noticed in the inspector, the player’s position Y increases passed 4.#### and then passed 7.#### when robots get close as they are chasing and firing. Once lifted up it stops the player from picking up items (ammo, armor and health) and once the position Y goes higher than 7.#### the player is not stopped by walls and can walk into the void.

Maybe I missed something during the tutorial but I backtracked the last 2 chapters (currently on chapter 11 page 294 right before Adding a Main Menu section) and cannot find a solution. Is there a use gravity or something that needs to be activated or set in order for the player to stay on the ground? or a way to lock player’s Y position?

As I test play it more, it seems like player walks on the robot when robots fire missile and animate back and gets lifted up. As if I do not walk towards the robots player stays on the ground.

Thanks for your time

Best Regards,
Rich

Also, I checked the final version of the source code for chapter 11 and it has the same problem, the player gets lifted (In Transform the Position Y increased to 5.4151 from the starting Position of 2.68) and there is no way of picking up items.

Hi @richg Thanks for pointing this out. We are updating the book as we speak for Unity 2017, so we will tackle this issue there.

OK, I have tried using a Ridgidbody to constrain Position Y (did not work) and in the player script using

void Update () {
Vector3 pos = transform.position;
pos.z = 0;
transform.position = pos;
}

although that keeps player on the ground but makes assaultRifle not animate correctly and causes undesirable game play like hesitant shaky camera action (I assume cause its updating Position Y every frame per second).


So what are my options returning the book and waiting for the new one?

Also, I am discontent with:

  1. For a $50 book I expected color pages. There are instructions that say in the red box -there is no red in a black and white images.

  2. After receiving the book on page 19 I read there is a pdf version. My firefox version and on my iphone searching on this website (nor Amazon) did not show there was a pdf version available, just a book. I have many books and this is the first where the pdf version is not a free download after purchasing the book and cost the same as the book, what a let down.

  3. All the grammatical errors going to be corrected as its very distracting when there so many errors throughout being that my book was printed July 05, 2017 (not even a month ago). The errors makes me feel unsure of the information’s integrity and correctness through the book. Making me second guess what I am trying to learn, especially when I have to make adjustments so game object fit right and match the layout and do not overlap each other. I have gone through a whole stack and some of Post-it notes noting most errors, from simple uf instead of if to a an image to added personal instructions that seem missing as I had to figure it out to proceed with the tutorial. I have not even yet gotten to the half way point of the book. Makes it seem like no one did a spell check before sending it to print.

  4. Under License (page 20), this is truly a first as none of my books ever restricts me from selling it without prior authorization (almost half of my collection are used books). This encourages me once I am done to donate it to the local library so that anyone in Miami can have access to the book.

Sorry to hear your frustrations.

With specific regard to the floating air bug. This seems to be an error that happened during one of the later Unity updates. 5.5 I think. When you update the project to Unity 2017 you will find the problem has gone away.

With regards to the grammatical errors I’ve notified the team and they will be keeping a close eye on each chapter for our next update as we always try our best to update the book for the latest version of Unity.

With regards to a PDF copy, contact support and they can sort out what your options are.

Unity 2017 has the floating issue. When I received the book a few weeks ago I had to make a decision of unity 5.x or the newer unity 2017. Since book states it requires unity 5.5 or later I went with the newest unity 2017 (version 2017.1.0f3) to begin with and had to update my OS to accommodate the unity 2017 requirements.

Thanks for your reply,
Rich

I’m having the same issue using the final release of 5.6. Bumping into a robot causes the player to be lifted up into the air.

There is a solution here: