- Home /
My space ship is sliding to one side and getting stuck there, what would cause this?
the ship once started moving, will slide to that direction until it reaches the maximum limit of that x coordinate. i can not get it to stop of move out of that "corner". is there something wrong with the code or anything? i am using unity 5.5, and attempting the space shooter tutorial, i believe i have translated the code properly, with the help of the pdf "upgrade" file.
Any input would be helpful.
https://answers.unity.com/storage/temp/109943-code-problem.png https://answers.unity.com/storage/temp/109944-code-problem-2.png
Answer by Honorsoft · Jan 24, 2018 at 11:30 PM
I had the same problem when I first tried the Space Shooter tutorial ( and when I made an 'Arkanoid' type game). As soon as I pressed left or right it would move to the edge of screen. I forget what was causing it, a simple fix I think. It might be helpful for others to know the values of you MIN and MAX values, but try to follow through your code (and any other scripts that may affect input/transform values), line by line, and see what it's doing. It could be a type-o somewhere adding too much movement. It could be an error in the input function where once the key is pressed it just stays 'marked' as pressed (GetKey and GetKeyDown work differently). If possible, compare a finished version of the project with your own.
i found a piece of my code that didn't match the tutorial section, . and the code fix turned out simply the correct piece.
Your answer
Follow this Question
Related Questions
can the space shooter tutorial be done without using webGL build? 0 Answers
Creating a spread shot using prefabs 0 Answers
Space Shooter Tutorial; Player won't move as shown at 7:05 in the Tutorial Video 3 Answers
Unity UFO tutorial question about code 0 Answers
enemy spawn without coroutine? 1 Answer