- Home /
Question by
BsID · Dec 28, 2020 at 05:59 AM ·
2dunityeditortopdowntankmouse movement
Slow rotation of mouse on 2d top down tank game
I am working on a top down tank game and the cannon part of the tank is separated from the hull. I have a script for cannon to rotate but when I flick my mouse fast the cannon also rotates fast which is not realistic at all with a tank. What I want is that the cannon part of the tank to rotate slowly towards mouse's angle (for example if I flicked my mouse from right top of the screen to bottom left of the screen the cannon will rotate 180 degrees slowly (in my case it look like teleporting if you flick it fast enough)).
Here is my script: https://pastebin.com/KrTX8z8t (Sorry don't know how to paste code here)
Comment