- Home /
Tank Controller/Script?
Hi, I'm currently developing a World War II Tank Game in Unity. I have attempted to apply the pre-made FPS character controller, and modified it by removing the controller's main camera and pasting the Smooth Follow script to another camera, thus allowing for smooth following of the tank as it moves. However, I have collided with two problems:
When I attempt to add a smooth follow script to the Tank's main turret, the turret will not move left or right despite the X-axis settings being -60 and 60.
The Tank does not feel realistic in terms of control whatsoever.
Does anyone have some advice should I attempt to create my own script?
Thanks.
EDIT In number one, I meant to say "$$anonymous$$ouse Look", not "Smooth Follow".
Tank control is actually quite complex if you want it to feel real.
It doesn't have to be realistic right NOW, I just need something to start with.
Answer by SirGive · Jun 07, 2011 at 09:08 PM
vel = (vel * 0.9) + (dir * 0.1);
Use this in order to gain a vehicle feel. It moves the forward vector to match the velcocity incrementally. It works nicely. vel is velocity of the object and dir is the forward.
Note: This is only the base movement.
Answer by Kjaxxis · Mar 03, 2015 at 12:19 AM
Do this: on the mouse look set the Y-axis sensitivity to 0 and max/min Y to 0. leave the max/min X-axis at 360 and enter Your game. Im also making a Tank game with WW2 tanks tanks. if you could tell me how to make them turn instead of sliding that would be nice
ok Step 1: make a empty turret prefab and attach anything that is supposed to be part of the turret. Step 2 : make a hull prefab and attach everything else to it. Step 3: add a mouse look script to your turret prefab and set the $$anonymous$$/max Y to 0 and sensitivity to 0 also. leave the $$anonymous$$/max X at 360. Step 4: enter the game and see if it works. it worked for me. it it doesn't... then.... uhh..... do something
oh and attach the gun wepon mount and everything on the turret to a new turret prefab so they wil all turn in unision. attach the turret to that prefab also
Your answer
Follow this Question
Related Questions
Simple Tank Controller 2 Answers
3rd Person Charter Controller Dont Play Animations 0 Answers
Character Flying around uncontrollably 2 Answers
how to flip a 3d character.,how can i flip my 3d character to the left? 1 Answer
Enemy Character Controller 1 Answer