Rotating Player Devlog #1
Hey guys heres the first official devlog and update of Dream Drop. Now If you have read or checked the main page, which id recommend for context you’d know that Dream Drop is in the prototype phase, but has most of the basic functionality implemented because of this I decided to ask for feedback. One critical piece of feedback was my rotating of the player, my module leader noticed that my player wasn’t rotating in the centre but instead in one of the corners (presumably). It wasn’t something I wanted to keep in the game, so I decided I’d spend my lab time today to fix it.
The first thing I did was to look to the internet for answers like great programmers do. I read a couple of different solutions, some posts suggested screwing around with pivots, but I read a better solution or easier for me at least. It suggested to create an empty object and make it the parent of the object I want to pivot which is the player and place it in the centre of the player. I then removed my rotateworld script which enables the player to rotate himself once he has frozen time and placed it onto the parent instead.
At first it seemed to have worked, when I ran the game he was rotating from the centre, but as I did further testing It still wasn’t working as intended. As I played further through my mock up level he would stop rotating from the centre and would move further away. I couldn’t understand why it wasn’t working. I thought it might have something to do with my movement script which might have been enabled when he was rotating which he shouldn’t. I checked it and it wasn’t that.
I went through lines and lines of code tweaking bits and pieces thinking that it might finally be why it wasn’t working, until I finally realised what the problem was! Because the movement script wasn’t on the parent the player would just move away from the parent object as the player would move around in the game. Once I moved my scripts to the parent it started working, woohay for me!
Such a stupid, simple fix, but thankfully for me it didn’t take too long to implement. The game feels so much better now and isn’t as frustrating as before. I think for next time I’m going to improve on my camera or improve how my rotating of the player works. I guess you’ll find out when you read tomorrows post, thanks for reading and ill see you guys in the next one.
Cheers!
Ed
Dream Drop
Status | Prototype |
Author | EdjNeal |
Genre | Platformer |
More posts
- Feedback Devlog #4May 31, 2019
- Camera Devlog #3May 17, 2019
- Snap trap Devlog #2Apr 24, 2019
Leave a comment
Log in with itch.io to leave a comment.