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 wajgamedev · Oct 13, 2013 at 12:24 PM · collisionphysicsweaponmeleeframe rate

Melee weapon collision inconsistent at low framerates

Hi, I've been working on a serious project as part of a team for several months now. I've been aware of this problem for a while, but the solution I came up with seemed time consuming and I wanted to wait to see if something better developed in the meantime. But with the project moving into alpha testing, I'm forced to give it another look.

Background:

  • I have kinematic rigidbodies with
    cube trigger colliders attached to my weapon objects.

  • The weapons are children of the player character's hand bone transform.

  • All of the (many) attacking animations are tied to the character rig and the weapon is just along for the ride.

  • I am happy with how it performs at 60 FPS.

The problem is that the weapon rarely travels in a straight line, so the interpolation between two points and rotations between frames is not accurate to the animation. It results in an attack whose area of effect is slightly different for every framerate. At lower framerates (sub 30), the faster attacks may not collide at all.

This is a PC game, so framerate scaling is a necessity. I can't just bring up the physics timing to 60 updates per second and call it good.

The (complex and probably terrible) solution I am considering implementing involves baking the important animation frames of each animation into the weapon object itself and giving it a script to correct itself if it becomes misaligned. The reason I don't want to do this yet is because it will require tweaking every time the animations are changed, which will be quite often in the coming months. Another option would be to create a trail of weapon colliders at particular frames based on the animation timing. They could update a little late and still be sufficiently accurate.

But I'm very much hoping I've overlooked something obvious. Thanks for any direction you can provide.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by meat5000 · Oct 13, 2013 at 12:26 PM

Read this

Its to do with the way FixedUpdate gets cut short to keep framerate consistent.

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

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

My sword pushes enemies around? 1 Answer

Full Performance On Melee Combat 0 Answers

How to stop my sword from hitting myself 2 Answers

Colliding Melee Weapons 2 Answers

Disable/Enable Colliders 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