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 Vire · Jul 02, 2012 at 09:15 AM · animationattackaimingfighting

Fighting Game - Aiming attack animation at mouse cursor?

Hi guys, I'm planning out a fighting game. The game will be a 2d sidescroller combined with arcade fighting type controls but using the mouse to aim your attack. All characters/enemies will be 3D rigged/animated models. If I make an animation for swinging a scythe (example) horizontally, (for the purposes of clarity, if I say 'horizontal' I mean there is no vertical component to the attack, not that the swing happens on a flat horizontal plane) how can I make it so that horizontal swing is aimed at the mouse cursor? Of course I could aim some of his spine/chest joints gradually towards the mouse, but that will end up making weird poses. I could also have a vertical horizontal (swinging horizontally, but aiming straight up at 180degrees from the ground) swing, a diagonal horizontal, and a horizontal horizontal.

Hope that isn't too confusing. I want the swinging animations to aim at the cursor and would love if someone could provide a starting point. I know I'll have to raycast from the mouse position to the world but this is more about getting the animation to point at the location.

Cheers

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
0

Answer by whydoidoit · Jul 02, 2012 at 09:20 AM

Hmmm, not at all easy - you are asking for an Inverse Kinematic solution I think where the animation is retargetted at run time. Looks like that is coming in 4 Pro, but there arent any solutions I've found and I'm half way through writing one, but may give up due to version 4.

Your best bet might be to rotate the bone near the chest having worked out the relative angle between that one and the scythe at the moment of impact. Full IK means working back from the end effector (tip of the scythe) though all of the bones in the body adjusting them to look natural (and taking into account the limited degrees of freedom of each bone).

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

With animator, ow to transit quickly from an animation, and transit back without replaying the complete animation 0 Answers

Play animation with collider [URGENT] 0 Answers

How to fix rig animation that stops short when increasing speed? 0 Answers

Can I make animations snap to a frame? 1 Answer

What is the best way to manage the attack and auto-attack animation per second when the object collides?,Best way to make 2 objects attack per time each other when colide? 0 Answers


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