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 Ben Colus · Nov 25, 2010 at 05:10 AM · soundgunfpstutorial

Problems implementing sound for machine gun enemy:

I'm using the generic sentry gun as outlined in the FPS tutorial, and have had a frustrating problem implementing sound. The tutorial describes how to put the sound in for the machine gun weapon, but it doesn't describe such a method for the sentry, and none of the obvious approaches seem to work.

I've tried attaching sounds to every aspect of the sentry, the muzzle flash, the impact sparks, etc, but I can't get it to make any noise. I'm using the sentry for a "run for cover" sort of challenge, so sound is very important (the player needs to know when it's stopped firing).

This isn't just for fun, I need this for a "build a level in two weeks" test for a game design job. My future in the industry depends on getting this right, so any help would be appreciated!

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 oliver-jones · Nov 25, 2010 at 06:29 AM

Okay doky, lets see what we can do here.

In your script, I'm assuming you will have a line of code that says:

// If we are almost rotated towards target - fire one clip of ammo
    var forward = transform.TransformDirection(Vector3.forward);
    var targetDir = target.position - transform.position;
    if (Vector3.Angle(forward, targetDir) < shootAngleDistance)

Simply add an:--> After the if statement

audio.Play();

What you want to do now is add an audio source to your turret, then drag your audio file into that source, and check play automatically OFF. Play the game and it should work, if not, Restart Unity. There is a bug in unity where the audio cuts out sometimes.

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 kkk · Dec 31, 2010 at 12:18 PM

Hi there i am looking for ww1 it says u will tell me about it. obviously not!

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 nowhereman · Dec 31, 2010 at 06:47 PM 0
Share

a)pick a better username, that one is offensive b)wth are you talking about? c)this is a community for people using Unity, a game developement program. Welcome. While some games may be about ww1, i would not recommend trying to learn about ww1 from any of the questions posted on here, as most, if not all, are about technical game issues, not subject matter such as ww1. if your reading is better than your spelling or grammar, i recommend you go to a library or find a website that is clearly about ww1

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

No one has followed this question yet.

Related Questions

Im trying to make a gun shoot sound 1 Answer

how to make gunshots 0 Answers

'FPS Tutorial' Machine Gun Script not working 7 Answers

Firing Sound 2 Answers

How can I make robot fire a machine gun? 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