Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by cerealwrath · Jun 07, 2011 at 08:26 PM · 3dcharactercontrollertank

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:

  1. 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.

  2. 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.

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cerealwrath · Jun 07, 2011 at 08:27 PM 0
Share

EDIT In number one, I meant to say "$$anonymous$$ouse Look", not "Smooth Follow".

avatar image almo · Jun 07, 2011 at 08:35 PM 0
Share

Tank control is actually quite complex if you want it to feel real.

avatar image cerealwrath · Jun 07, 2011 at 08:37 PM 0
Share

It doesn't have to be realistic right NOW, I just need something to start with.

avatar image SirGive · Jun 07, 2011 at 08:40 PM 0
Share

I've got something. Hold on. Let me dredge up some code.

avatar image cerealwrath · Jun 07, 2011 at 08:45 PM 0
Share

SirGive, are you providing this code free of charge?

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kjaxxis · Mar 03, 2015 at 12:22 AM 0
Share

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

avatar image Kjaxxis · Mar 03, 2015 at 01:20 AM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges