Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 BaterieCZ · Nov 23, 2014 at 07:34 PM · velocityspeedprojectile

Tank projectile speed

Hey, Need help with setting the velocity of objects.

I'm doing online tank game. I want the real tanks. For example, M1 Abrahams tank (USA) has a muzzle velocity 1600 m/s (M829A1 projectile). When this speed reaches with shoot script, projectiles passes terrain and other colliders objects. I have already installed the script 'DontGoThroughThings', but it does not help.

Any advice?

(Sorry for my bad english, I'm Czech)

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Jeff-Kesselman · Nov 23, 2014 at 07:38 PM

Three pieces of advice.

(1) You are experiencing a frame miss. The projectile is moving so fast that it is on one side of the object in one frame and the other side in the next, never intersecting. You can fix this be setting the collision mode for the projectile to 'continuos" on its RigidBody http://docs.unity3d.com/ScriptReference/CollisionDetectionMode.html HOWEVER this is pretty expensive calculation wise.

(2) Do you really want your shells to go that fast? Unless there is a reason why you need military accurate simulation, like this is a military training sim, being more realistic often isnt more fun. You want cinematic, not realistic, for a game.

(3) if you really want it to move that fast, is it even visible? Maybe you should just do a line cast and do an instantaneous hit calculation.

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 sevensixtytwo · Nov 24, 2014 at 02:11 AM

I've done fast projectiles before and DontGoThroughThings helps a lot (yes, also with tank guns going 2000+m/s). Make sure your scaling things properly (1 unit = 1 meter). Wrong scaling can cause a crapton of problems with physics detections. Also, using large box colliders rather than small mesh colliders is a big help.

My only problem with DontGoThroughThings is it still relies on a collision between the projectile's collider and an obstacle. Through the vagaries of FixedUpdate, the projectile may actually collide with something before the raycast fires, causing a miss.

I have a bullet code with a modified DontGoThroughThings integrated that only uses Raycasts to detect collisions rather than a collider here:

link text

Check the first answer and modify to your needs. Instead of setting the projectile's position to the collision point and causing a collision, it simply tells the bullet that it hit something and calls the "Destruct" function. Much faster and consistent since there is no chance the bullet will hit something behind the target before the raycast is fired.

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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to control the speed of the projectile motion? 1 Answer

How do I accelerate particles in Shuriken? 1 Answer

Projectile Trajectory Velocity, with predefined Start and End Positions 0 Answers

Need some help with firing projectile at player using Rigidbody Velocity 1 Answer

Speed based on distance 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