Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 connoradams251 · Feb 26, 2018 at 07:00 PM · rotationaudiospeedissues

Problem With Rotation Speed and Problem With Audio

I have been following a Udemy guide to Unity: https://www.udemy.com/become-a-game-designer/


It has its problems with being up to date, but I have been able to solve most of them until now. First off the rotation speed doesn't change even if I change it from 20.0f to 100.0f.


Here's the code: https://pastebin.com/KYUKy67S

Fixed code: https://pastebin.com/4Q4kQMeZ


The other problem is with sound. It gives me an error saying this: Assets/Scripts/TriggerEvent.cs(18,10): error CS1061: Type UnityEngine.Component' does not contain a definition for PlayOneShot' and no extension method PlayOneShot' of type UnityEngine.Component' could be found. Are you missing an assembly reference?


Here's the code for that: https://pastebin.com/A2PYHg7m

Fixed code: https://pastebin.com/7P4S3DgW


I'm pretty new to Unity and I don't know how to solve this. Thanks in advance.

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 Xysch · Feb 26, 2018 at 07:10 PM

In the first code you never used the rotationSpeed variable, you used speed and -speed instead of rotationSpeed in your rotate function. For the audio one I'm not too familiar with audio but it seems you didn't assign anything named audio or PlayOneShot. Hope this helps!

Comment
Add comment · Show 1 · 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 connoradams251 · Feb 26, 2018 at 07:15 PM 0
Share

I have no idea how I missed that. Thank you! I'm not at all familiar with PlayOneShot but I'm pretty sure my code matches the instructor's code in the videos. I'll check but I think the second one has to do with his code being outdated.

avatar image
0

Answer by Chik3r · Feb 26, 2018 at 08:00 PM

Hi @connoradams251
For your problem with playOneTime: First your object must have an audioSource attached or have a reference to a source in the scene. Then you must give it a reference to a clip. Then you must call PlayOneShot which is in the audioSource with the following args: 1. Required: The clip to play. 2. Optional: The volume scale. And thats it!

Image goes here


helpuanswers01.png (21.1 kB)
Comment
Add comment · Show 2 · 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 connoradams251 · Feb 26, 2018 at 08:57 PM 0
Share

I've fixed all errors other than this one:


Assets/Scripts/TriggerEvent.cs(39,10): error CS1061: Type UnityEngine.Component' does not contain a definition for Stop' and no extension method Stop' of type UnityEngine.Component' could be found. Are you missing an assembly reference?

avatar image connoradams251 connoradams251 · Feb 26, 2018 at 09:13 PM 0
Share

I have fixed this error. Thank you for the help!

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

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

Related Questions

Why is my character so slow? 1 Answer

Rotation with different speed for different axis 2 Answers

How to change the speed of an audio clip? 1 Answer

How to modify the rotation speed of an object using Transform.Rotate 3 Answers

Speed of player depends on angle of rotation 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