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 Panik.Studios · Mar 08, 2014 at 01:38 AM · rotationspeed

How Do I Add speed to my rotation

I have two scripts for pinball flippers... They rotate where they are supposed to, but it's so fast that collision isn't being detected by the ball when they are moving! I looked all up and down google for a solution to my problem, but I'm not getting anywhere

Please HALP Me! Thanks!

function Update () {

if(Input.GetButtonDown("RightFlipper")){

 transform.Rotate (0, -81, 0);
 }

if(Input.GetButtonUp("RightFlipper")){

 transform.eulerAngles = Vector3(0, 277.81, 180);
 }

}`

 function Update () {
 
     if(Input.GetButtonDown("LeftFlipper")){
     
     transform.Rotate (0, 81, 0);
     }
     if(Input.GetButtonUp("LeftFlipper")){
     
     transform.eulerAngles = Vector3(0, 180, 180);
     }
 }


Also I can't ask my questions 3/4 of the time because of the tag error? And it doesn't give me tags to select from? Not sure how after however many years this is still a problem with the site?alt text

Comment
Add comment · Show 1
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 woodoo · Mar 08, 2014 at 03:33 AM 0
Share

AddTorque(..)? Use it in your Rigidbody.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by highpockets · Mar 08, 2014 at 02:11 AM

Check this out:

http://wiki.unity3d.com/index.php?title=MoveObject

Comment
Add comment · Show 6 · 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 Panik.Studios · Mar 08, 2014 at 02:41 AM 0
Share

I wouldn't even begin to know how to Use that lol

avatar image highpockets · Mar 08, 2014 at 03:26 AM 0
Share

does the ball or the flipper have a rigidbody attached? Or do both?

avatar image Panik.Studios · Mar 09, 2014 at 05:49 AM 0
Share

I decided to go with a hinge joint because the flipper was going through the ball with rotate for some reason. The ball is the only thing in my project with a rigid body. It's all working how I want now, but for future reference I would still like to know how to change the speed of transform.rotate (as that was my question here).

avatar image highpockets · Mar 09, 2014 at 07:32 AM 0
Share

Well, this would rotate 1 degree a second on the y axis, which is really slow:

 transform.Rotate( 0, Time.deltaTime, 0);

but of course you could multiply it by how many degrees you want it to move per second and make it negative to go the opposite direction:

 transform.Rotate( 0, -Time.deltaTime * 10, 0 );

That would rotate it in the opposite direction at a rate of 10 degrees a second. You could find out the angle either by calculating the time that has passed or of course by checking the euler angles.

avatar image Panik.Studios · Mar 10, 2014 at 01:45 AM 0
Share

that might work.. would need a clamp but I think that would be pretty good.

Show more comments

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

22 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Slowing Down Rotation Speed 1 Answer

Object Rotation/Character Speed 1 Answer

Player won't look in direction and travel at the same time? 2 Answers

Sprite facing object to mouse 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