Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
4
Question by Heratitan · Oct 06, 2010 at 01:27 AM · rotationquaterniontargetconfigurablejointpinball

Using Configurable Joints to create Pinball Flippers?

So, for a while I have been trying different methods of making pinball flippers for my game. After a ton of trials and a some reading I am pretty sure that Configurable Joints will be the best way of making a pinball flipper. I know I have to set the target rotation and have the joint rotate to that point, but I'm not sure how since Quaternions confuse me. I was wondering if anyone could recommend a good way to use the joint to make it a flipper or how to set the target rotation.

Thanks

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

3 Replies

· Add your reply
  • Sort: 
avatar image
6
Best Answer

Answer by Peter G · Oct 06, 2010 at 02:43 AM

Configurable Joints are really overwhelming unless you are willing to go through and figure out what properties you need. My character in my current game uses them, and it took forever to actually set up the motion. If you do, then here would be the steps.

  1. Set the rotation mode for y/z to position, and set the properties to be whatever speeds you want.

  2. In your Script, you don't really need to know almost anything about Quaternions. Just use Quaternion.AngleAxis(desiredRotation, Vector3.up); Then use GetComponent to find your configurable joint and change the target rotation to that Quaternion and it will "flap" itself to that angle at the force your properties defined. You probably want world space (Use World Space [check]) so you might have to transform the rotation based on the flappers up direction. i.e. Transform.up. Now, I always use world space, but you could use local space to as long as you account for rotating the object in the scene view.

  3. Then set the target rotation to Quaternion.Identity to reset your flapper.


Now, what I would do to save yourself a lot of time is to just use a hinge joint. Configurable joints are for when you have a specialized movement such as a complex character that is still physics controlled.

Hinge joints will let you specify a target rotation and the amount of force to move to it. Then, all's you have to change is the desired angle, no eulers or quaternions ore Vectors, just floats :).

And, given a flapper's movement is on a hinge, you would just end up spending extra time working out that behavior in a configurable joint.

Plus, hinge joints are easier to look at in the inspector. Configurable joints have so many properties that especially if you only use a few, you still have this blocky mass to go through when you want to tweak something. Which, all the properties have a useful purpose, but most objects will not use all of them at one time.

Comment
Add comment · Show 3 · 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 Heratitan · Oct 06, 2010 at 03:27 AM 0
Share

Thanks I'll try this out.

avatar image Heratitan · Oct 06, 2010 at 10:08 PM 0
Share

Thanks, you rock

avatar image aeroson · Aug 01, 2013 at 06:21 PM 0
Share

I love you

avatar image
1

Answer by LS16BMX · Jan 03, 2012 at 11:44 PM

It might help to up your max angular velocity in the physics manager ! This will let your flipper flip much faster :O)

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 GeorgeRigato · Apr 20, 2011 at 08:02 PM

I'm doing the same pinball project, and trying to use Hinge Joints.

The issue i find is that the min and max angles do not limit the movement, they just act sort of gravity wells, dragging the object slowly to the position, causing a lot of bounciness (my bounciness config at the inspector are all Zero).

To move the flipper fast enough you have to apply a large force to the rigidbody, making the object to pass the max angle.

If anyone could just shed some light on a particular config that make the hinge joint behave like a real flipper would help.

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

2 People are following this question.

avatar image avatar image

Related Questions

How to transmit the correct rotation (quaternion) to an configurable joint? 1 Answer

Rotate towards target around axis with limits 0 Answers

How to fix this strange child 3D rotation? 0 Answers

Pinball Flipper using Quaternion.Lerp? 1 Answer

Determining Look Rotation As > A Number? 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